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 |
rum23
Yak Posting Veteran
77 Posts |
Posted - 2009-01-26 : 11:03:15
|
I have 50+ sql scripts files that contains changes to the database. Right now, I open each sql script file in the query analyzer and execute it which can be tedious. Is there a way to run these sqlscripts from a MS-DOS batch file? If so, please let me know how. Thanks a lot for your help. |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-01-26 : 12:11:42
|
Here comes an old batch-code i have used in the past.setlocalSET ISQL=isql -Smyserver -dmydatabase -Umyuser -Pmypasswordfor %%d in (*.sql) do %ISQL% -i%%d -nendlocal Hope that helpsWebfred No, you're never too old to Yak'n'Roll if you're too young to die. |
|
|
heavymind
Posting Yak Master
115 Posts |
Posted - 2009-01-27 : 07:59:31
|
Probably the only change would be to use sqlcmd instead of old isql...Thanks, VadymMCITP DBA 2005/2008Chief DBA at http://www.db-staff.com |
|
|
|
|
|