September 13, 2004 at 9:29 pm
How to execute a list of stored procedures from a batch file with output going into several csv files?
September 14, 2004 at 6:11 am
I'm not sure I understand the problem. If you mean a CMD or BAT script why not just make multiple calls to osql, one for each output file?
September 15, 2004 at 5:34 pm
Yes how to do the above in a batch file. ie Could you give me an example please?
I've tried;
osql -E -Sservername -dmaster
exec sp_helpdb > 1.csv
This didn't work.
September 16, 2004 at 6:19 am
YourCmd.cmd =
osql -U username -P password -S SrvName -d dbName -n -i input1.sql -o 1.cmd osql -U username -P password -S SrvName -d dbName -n -i input2.sql -o 2.cmd osql -U username -P password -S SrvName -d dbName -n -i input3.sql -o 3.cmd |
input1.sql =
set nocount on exec sp_helpdb |
input2.sql =
set nocount on exec sp_who |
input2.sql =
set nocount on SELECT * FROM SYSINDEXES |
Should you have need to get return values back to your batch script refer to my post at:
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=23&messageid=136563#bm136607
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply