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 |
Hariarul
Posting Yak Master
160 Posts |
Posted - 2006-08-08 : 02:09:07
|
Hi,How do I execute all the .sql scripts in a folder ?Thanks in advance,Hari Haran Arulmozhi |
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-08-08 : 04:20:16
|
Have a look at http://www.nigelrivett.net/SQLTsql/s_ProcessAllFilesInDir.html@ProcSp would be an sp to execute the osql command via xp_cmdshell.You could probably use a batch commmand redirecting the output from a dir command also.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
Hariarul
Posting Yak Master
160 Posts |
Posted - 2006-08-08 : 04:41:53
|
Thanks for the quick response !! Is there any way to do the same with a batch file ? |
 |
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-08-08 : 05:57:18
|
something likefor %1 in (*.txt) do osql %1 ...==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
Hariarul
Posting Yak Master
160 Posts |
Posted - 2006-08-08 : 06:48:39
|
Ok , Thanks !! |
 |
|
|
|
|