从isql输出中删除空格 [英] Remove white space from isql output

查看:65
本文介绍了从isql输出中删除空格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以阻止 isql 在返回的字段前后添加空格吗?我只希望表行中的值由分隔.目前,使用 -b -s',',我得到:

Is there any way to stop isql from adding spacing before and after the returned fields? I just want the values from the table row separated by ,. At the moment, using -b and -s ',', I get:

,some_column_entry         ,          3213,            another_column_entry,

但是,我想要

,some_column_entry,3212,another_column_entry,

我通读了所有开关,但似乎找不到任何合适的开关.我的愿望是让 isql 以这种形式输出,而不是解析输出.

I read through all the switches, but couldn't seem to find anything appropriate. My wish is to get isql to output in this form rather than parsing the output.

编辑:

select top 1 rtrim(ltrim(some_column)) from table

返回

,abc             ,

isql 似乎基于最大字符的大小输出,因为如果我运行以下命令,则:

isql seems to output based on the size of max characters, because if I run the following:

select top 1 rtrim(ltrim(convert(varchar(3), some_column)) from table

我得到:

,abc,

推荐答案

尝试一下

    Use RTRIM(LTRIM(ColumnName)) in your -q Query Select command.

这篇关于从isql输出中删除空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆