Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
daluu
Starting Member
2 Posts |
Posted - 2008-09-17 : 18:33:11
|
I'm using sqlcmd to log the query results into CSV format.Unfortunately, there is some cleanup work involved to get a nice CSV file like deleting the "---" row that delimits the column header row from the data rows and removing the extra blank lines and "(x rows affected)" line at the end of the fileBut I also notice the output is somewhat tab delimited, where extra trailing white spaces are inserted in the output to align the columns. Is there a way to not pad the results with trailing white spaces, etc.?Here is the command I use:sqlcmd -S LOCALHOST -E -i "script.sql" -o "output.csv" -s ","I could do an XML query output instead but would prefer to keep my SQL select queries non-XML. |
|
jezemine
Master Smack Fu Yak Hacker
2886 Posts |
|
daluu
Starting Member
2 Posts |
Posted - 2008-10-07 : 14:18:10
|
thanks. missed that option somehow. |
 |
|
|
|
|