Showing posts with label outputit. Show all posts
Showing posts with label outputit. Show all posts

Friday, March 23, 2012

formatting question with osql batch file

Hi all,

This is my first batch file and I want to query a database and output
it in a textfile. Up to now that works, the only problem is the
formatting in the text file. It's all screewed up...lines aren't lined
up and columns aren't right...how do you format the result from a
query to a text file. Here's my code:

osql.exe -S MYMACHINE -w 30 -E -d Demo2 -Q "select * from Title where
frequency = 'monthly'" -o "C:\output.txt"

Thanks...
JMTFigured it out guys...thanks...
It was because by default it only writes 80 characters per line if you
don'T specify how wide your columns should be. I had columns about 50
characters wide in my table...

Later,
JMT