MelissaC
asked on
Query Analyzer: Run sequence of files
Hi All,
I want to create a script that says:
- Run scriptfile 1 (create database script)
- Run scriptfile 2 (create stored procedures script)
- Run scriptfile 3 (fill database script)
What is the syntax for this?
I want to create a script that says:
- Run scriptfile 1 (create database script)
- Run scriptfile 2 (create stored procedures script)
- Run scriptfile 3 (fill database script)
What is the syntax for this?
ASKER
OK, so I can create a .bat file to do this. But isn't there a way to say it in a sql-script file?
Some kind of <execute file> statement or something?
Some kind of <execute file> statement or something?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
osql.exe -dDatabaseName -E -iInputfile -oOutputfile -SserverName
for the create database specify Master or Tempdb as the database
use -E for a trusted connection or -Uuserid -Ppassword for a sql server login...
invoke osql 3 times once for each script type...