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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Really Simple SQL Question

Author  Topic 

terryphillips
Starting Member

1 Post

Posted - 2007-09-18 : 11:56:40
SQL SERVER 2005.

Very simply I'm looking to create a database build script which executes one .sql file after another.

in Oracle I would have a build file containing @. /path/filename.sql, then execute the build script using @buildscript.sql from with a db client.

Very similar in MySQL where I would have SOURCE filename.sql to execute sql contained in a sql script without having to copy/paste the sql to the client.

How can I achieve this in SQL SERVER 2005, I have many sql scripts in .sql files that I want to execute one after another?

Thanks.

X002548
Not Just a Number

15586 Posts

Posted - 2007-09-18 : 12:03:45
Create a bat file that executes osql, 1 line per *.sql script

Then you can execute manually, or from a sql server job



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page
   

- Advertisement -