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 |
afonso.rodrigues
Starting Member
1 Post |
Posted - 2014-05-22 : 14:39:44
|
Hello,I'm Afonso Rodrigues, Developer Java, user Database.I'm looking for a procedure to export of result query in .txt or .csv.I'm finding bcp and sqlcmd. But it this a single possibility?Afonso Rodrigues |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-05-22 : 14:58:13
|
I'd use bcp. Here's an example:bcp.exe "select column5, column8 from database1.dbo.table1 t1 join database1.dbo.table2 t2 on t1.column1 = t2.column1" queryout c:\temp\bcpout.csv -c -t, -T -Sserver1\instance1 -r\r\nTara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
|
|
|