views:

91

answers:

1

How do you specify the the row terminator when outputting query results using sqlcmd?

bcp is not an option.

sqlcmd -E -s"   " -Q "Select * From SomeTable" -o C:\Output.txt  -W

What is the default row terminator?

A: 

You can only choose column separator with -s. There is not option to specify row terminator.

So it is CR + LF because the output goes to command line. However, data may be truncated so you have to control the output width.

See sqlcmd for -s, -w, -W, -y, -Y etc

bcp may not be an option, as you say, but neither is row terminator in sqlcmd...

gbn