Generating a Database
Last modified: October 23, 2019
You can use the Generate Scripts Wizard to create scripts for transferring a database between SQL Server instances. You can generate scripts for a database on an instance of the Database Engine in your local network, or from SQL Database. The generated scripts can be run on another instance of the Database Engine or SQL Database. You can create scripts for an entire database, or limit it to specific objects.
Generating a Script
-
In Database Explorer, expand the node for the instance containing the database to be scripted.
-
Point to Tasks, and then click Generate Scripts.
-
On the General page, in the Load a previously saved project section, click Open to select a previously saved *.backup file. If you do not have the project file, go to step 4.
-
In the Connection list box, select an instance of the SQL Server database engine.
-
In the Database list box, select a database.
-
Click “…“ next to the Path text box, to select a folder to store schema export.
-
In the Output file name text box, specify a name of the file.
-
Optionally, you can select the Append timestamp to the file name option to add date-time parameters to the file name.
-
Optionally, you can select the Use compression (ZIP) option to compress the script file.
-
On the Script content page, select what you want to generate. You can also include or exclude specific database objects.
-
On the Options page, specify how you want this wizard to generate scripts. Many different options are available.
-
On the Error handling page, specify errors processing behavior and logging options.
-
Click Generate.