execute other querries in other sql file. | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

execute other querries in other sql file.

i have two sql files.
– one with create table statements
– one with fill table statements. when i execute the first .sql file, is there a statement or command to let automatically execute the second script, at the end of the first?
Why two separate scripts?
[duplicate post – funny, yes – intentional, no]
Adriaan: I suppose for this one: http://www.sql-server-performance.com/forum/topic.asp?TOPIC_ID=20519 Luis Martin
Moderator
SQL-Server-Performance.com All in Love is Fair
Stevie Wonder
All postings are provided “AS IS” with no warranties for accuracy.
@Adriaan: why to use several script files:
Because we have hundreds of sql files (*), and one master sql file that calls them all. this approach was choosen, because it’s easier to find things back in well-grouped, separate files. (*) those files have been created for our oracleDB years ago. client company rule was to install everything via Sqlplus (where that approach was very easy). now client wants to have the same database on a sql server 2005. appearently this approach is not common in the sql server world 🙁
only thing i foudn is sqlcmd.
appearently sql server people want to work with ONE MASSIVE sql file. terrible.

First assumption is to stop comparing or taking Oracle approach here, there are other methods in SQL arena to use them effectively. As suggested refer to your other post as it is mentioned about SQLCMD where you can control the method of execution. (this post is locked), Satya SKJ
Microsoft SQL Server MVP
Writer, Contributing Editor & Moderator
http://www.SQL-Server-Performance.Com
This posting is provided AS IS with no rights for the sake of knowledge sharing. The greatest discovery of my generation is that a human being can alter his life by altering his attitudes of mind.
]]>