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
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Executing SQL Scripts via an executable .exe

Author  Topic 

amsqlguy
Yak Posting Veteran

89 Posts

Posted - 2012-04-11 : 07:36:31
Hey guys

With every internal application release we have bunch SQL scripts which are checked into VSTS to execute in mutliple databases (which are on same build) in the following order.

Schema File
DDL File (only for Functions, Views, Reports)
DML File

Is there any way to execute these scripts as an exe file which is available by passing the paths for the files with execution order.

I have looked at SQL Packager from SQL Red Gate - wanted to know if there are other options/tools available.

Any suggestions/inputs will be helpful.

Thanks

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2012-04-12 : 11:25:25
The short answer is yes, this can be done pretty easily. We developed an in-house application that does just what you have outlined. You point it at a directory and it walks through the scripts and executes them. It's also smart enough to interface with our source control system so it can get the latest files first, if desired. It also knows about the set of servers and databases involved so it can deploy to a myriad of environments with one click. In response to your next question, "No" I cannot give you the application but it is not that hard to put together.

=================================================
There is a foolish corner in the brain of the wisest man. -Aristotle, philosopher (384-322 BCE)
Go to Top of Page
   

- Advertisement -