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 - 2003-11-10 : 07:16:23
|
| Goutam writes "Can we create the CSV file from query. I am using 2 alternatives1) By osql utility, creating CSV but not getting proper format2) Another way is creating DTS package and do the transformation.Let me know is there any better way to accomplish the objectiveGoutam" |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2003-11-10 : 07:29:03
|
| You can also use bcp to output a CSV formatted file (or any delimiter, or fixed-width). It is a command-line utility like osql but is designed specifically for outputting data to files. Books Online has more information on bcp. |
 |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2003-11-10 : 07:50:34
|
| Or you could use the FOR XML clause on your query and an XSL transformation to create a CSV file.Damian |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2003-11-10 : 07:53:27
|
Yeah, but then you'd also have to write your own custom regular expression parser and TCP/IP stack program too. |
 |
|
|
|
|
|