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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-02-10 : 19:27:47
|
| Paul writes "IN SQL Script how do I create an empty csv file, and write to it?Thanks in advancePaul" |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-02-10 : 20:00:08
|
| The bcp command-line utility is actual the easiest way to create a CSV file. You can call it from T-SQL using xp_cmdshell:EXEC xp_cmdshell 'bcp "SELECT * FROM pubs..authors" queryout c:\mydata.csv -Sserver -Uusername -Ppassword -c -t ","'Check Books Online for more details on bcp. |
 |
|
|
|
|
|