0

I am trying to write a process in mssql where I will extract data from tables and query it out to flat file. Which is the best approach to do this? should I use bcp or osql? I can't opt for ssis as the company has no budget to get BIDS.

Please help!

4

1 回答 1

0
Exec master..xp_cmdshell 'bcp "select name from sysobjects" queryout "c:\tempexportfile.txt" -c -T -SYourServerName'
Exec master..xp_cmdshell 'type "c:\tempexportfile.txt" >> "c:\mainexportfile.txt"
于 2013-10-17T14:25:24.627 回答