TSQL command to call *.sql files
I have several *.sql files with script to create table and sprocs for a new database.
Is there a way to create a TSQL script that could be run from the SQL Query Analyzer that would sequentially call the *.sql files?
Example: call scrip 01; call scrip 02; call scrip 03; GO
Sorry but I was not able to express my problem properly before.
I need create a Db with many tables, at the moment all scripts are in a unique file (very long).
I use MS Management Studio to run the script in query editor to make the database.
Because this script is very long, I was thinking to split it in different small pieces.
So I would have a main script which will order the execution of separate script to run. example
script1 script2 script3
etc
Do you know hot to do it in TSQL on MS SEL 开发者_Go百科2008. thanks once again
I use SQL Server 2008
Use SqlCmd mode in SSMS:
http://msdn.microsoft.com/en-us/library/ms174187.aspx
:r filename
Not sure if this works in Query Analyzer though.
精彩评论