ApexSQL Script is a SQL Server database migration tool which can create SQL scripts by converting SQL database objects and data into a single or multiple deployment SQL scripts, .NET solutions, or executable installers. In many cases when moving a SQL database, there’s no need to migrate the entire SQL database, but only a part of it.
ApexSQL Script offers the possibility to select specific SQL objects and have them included into a sample or testing SQL script. It is even possible to combine multiple SQL databases and extract SQL objects from multiple SQL databases at once.
In the following steps the complete process will be explained:
-
In the New project window, connect to a desired SQL Server and select databases to choose objects for creating DDL and DML SQL scripts, and click the Load button:
-
From the Main grid, it is easy to select only specific SQL objects, and have them included into the required SQL script. Click the Structure view and select objects to include in DDL script:
-
Click the Data view and select objects to include in DML script:
If there is no need to include all tables/columns/rows, check out how to narrow the data sub-set for object scripting
-
After the SQL object selection is complete, the next step for creating SQL script is to click the Script button, located in the Home tab under the Actions section:
-
The process leads on the to the Script wizard, which offers users to set up the Scripting mode and Output type.
Here, it is possible to select either the Structure (DDL) or Data (DML) scripting mode, or the combination, through the Structure and data mode:
-
In the next step of the Script wizard, choose the SQL script as the output type:
-
When it comes to scripting, especially if only specific SQL objects are scripted, it is important to process its dependencies. ApexSQL Script ensures that all required dependencies are included and in the following dialog an overview and option to include/exclude specific dependencies are shown:
-
In the last step, the final adjustments can be made, through the setup of the output file name and its location:
-
Once everything is set, click the Create button and the Results dialog will be shown upon finished process:
ApexSQL Script offers a simple and comprehensive process of creating SQL scripts for both, DML and DDL, making it an easy task even if it is performed repeatedly and frequently.
March 5, 2015