Naturally, the first choice is to just use BCP itself:
bcp “SELECT * MyDataBaseNameHere.MySchemaNameHere.MyTableNameHere” queryout c:\blah.csv -S ServerNameHere -T -t “|” -c
Or, for those little times where you just need a delimited bunch of rows of the data in a table, do the following to leverage Sql Server Management Studio:
-
Open a new query window.
-
Set the Query\Results To\Results to Text
-
Go to Query\Query Options \Results\Text and make the following settings:
-
Output format: Custom Delimiter
-
Specify the custom delimiter
-
Turn off “Include column headers in the result set”
-
Expand the Maximum number of characters displayed ( set to the highest of 8192)
-
-
Run your query, copy the text into your text file.
Ok, kind of a lame post.
J