MS SQL Server OSQL - Column format/length

MS SQL Server OSQL - I am running a query using osql and returning the resultant output to a file.  

It appears the minimum length of each column returned is 4 characters.  eg Try " SELECT '1' " as the query and it returns 4 characters, ie "1   ".  

Is there any way to to get rid of this apparent 4 character minimum per column?  I am  using the arguments -s -n -h-1 -m-1 -w 145 -b when running the query.
mgreifAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SimonLarsenCommented:
try

select cast (1 as int)

or

select ltrim(rtrim(1))
0
muzzy2003Commented:
No there isn't. Sorry for the blunt answer.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
muzzy2003Commented:
If you want more control over the output format, then consider using DTS rather than osql. You can still run this from the command line using the DTSRUN utility.
0
mgreifAuthor Commented:
Thanks, I was sure that was the case since I couldn't find anything on it, but since I am fairly new to MS SqlServer, I wanted to find out!
0
muzzy2003Commented:
Thanks for the revision.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.