kizziebutler
Programmer
Is it possible to execute multiple bcp commands after one has just completed.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
declare @sql varchar(1000)
--set first bcp
set @sql = 'bcp "SELECT * FROM Table" queryout "\\server\folder\filename.txt" -c -q -S"ServerName" -T'
exec master..xp_cmdshell @sql
--set second bcp
set @sql = 'bcp "SELECT * FROM Table2" queryout "\\server\folder\filename.txt" -c -q -S"ServerName" -T'
exec master..xp_cmdshell @sql
@for /F %a IN (views.txt) DO BCP "%a" output "d:\outputpath\%a.txt" -S SERVERNAME –T –t "," –w