See how to script both structure and data for a database, and how to compile it into a .Net executable
The good news about the executable is that it can be executed even on the workstations without the SQL Server client tools installed
- Run ApexSQL Script
- Connect to a SQL Server instance
- Select a database and click Load
- Select the objects to script on the Structure tab
- On the Data tab, select the tables in views of which you want to script the data
- On the Home tab, in the Actions group, click Script wizard
- Select Structure and data in the Scripting mode page:
- Click Next
- Select the Include dependent database objects option to avoid constraint problems
- Click Next
-
Select the options for the executable file
- Check Run executable now to execute the created exe file immediately after it’s been created
- Specify the database name, MDF and LDF file directories, collation, recovery model, and size
- Click Create
- Specify the file name and the patch for the created file. The executable file is started as soon as it’s created
- Select Create new database, specify the database name to create a new database, and run the file against it
- To specify what to do when an error is encountered, click Options and in the Error handling section choose between Abort, Ignore and Ask for confirmation options:
- Specify the database MDF and LDF file directories, collation, recovery model, and size on the Database properties pane:
Select Executable installer in the Output type page:
Last updated
August 21, 2018