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 |
|
Bouch
Starting Member
2 Posts |
Posted - 2004-12-16 : 12:00:45
|
| Hi folks,I'm trying to write a script which simply executes a series of pre-existing scripts. This is so I can ensure that the load script for certain tables gets executed before others.I've tried everything I can think of, including somethings that work on other transact-SQL based databases (like "read c:\sql\script1")This has got to be easy, but damned if I can find how to do it.I've rummaged through the ISQL help files, but can't find anything like "run" or "exec" that works on script files, they all seem to be for stored procedures.Help!Thanx!Mike |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2004-12-16 : 13:11:20
|
| Put the code in a *.sql fileAnd place this in a *.bat file"C:\Program Files\Microsoft SQL Server\80\Tools\Binn\osql" /d PathWeb2 /S PAERSCBVD0014 /U sa /P /i F:\Projects\EFindPru\HotFix_2004_11_09.sql /o F:\Projects\EFindPru\HotFix_2004_11_09.logBrett8-) |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2004-12-17 : 02:49:48
|
| Have a batch file which does:TYPE MyFileA.SQL >MyBigFile.SQLTYPE MyFileB.SQL >>MyBigFile.SQLTYPE MyFileC.SQL >>MyBigFile.SQLand then execute MyBigFile.SQLRe-run the batch file whenever any of the "element" files changeKristen |
 |
|
|
Bouch
Starting Member
2 Posts |
Posted - 2004-12-20 : 14:29:36
|
| Thanx X002548, that worked great.Mike |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2004-12-20 : 16:37:37
|
| Thanks for letting us know it worked...Brett8-) |
 |
|
|
|
|
|