How to consolidate multiple SQL scripts into a single SQL script

Having multiple SQL scripts and running them against a SQL database can be demanding. ApexSQL Build is a tool that can build databases from SQL scripts. The ApexSQL Build  Consolidate scripts feature can combine multiple SQL scripts into a single SQL script in a very simple way, and more importantly, it can significantly decrease deployment time

The feature is easy to use via the Consolidate scripts option in the main window of ApexSQL Build:

Combining multiple SQL scripts into a single script can be done in a few steps. First, add script files that should be combined. The order of the scripts execution can additionally be changed, as sometimes the order of scripts can determine and change the whole deployment process, or even prevent the deployment from being executed. For changing the order of scripts, there are the Up/Down buttons available

After selecting the necessary scripts, ApexSQL Build offers output actions to create and save the script to a file or to open script in the editor:

Finally, there’s a possibility to create a package version located under the Version tab, to keep track of script packaging and changes in case of repeating the session with additional updates

After choosing the appropriate output action, the combining process is complete, and all the necessary SQL scripts are combined into a single script

The main advantage of using this feature is its simplicity and time saving when it comes to combining multiple SQL scripts into a single one for easier deployment

March 12, 2015