Generating a Database

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

  1. In Database Explorer, expand the node for the instance containing the database to be scripted.

  2. Point to Tasks, and then click Generate Scripts.

  3. 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.

  4. In the Connection list box, select an instance of the SQL Server database engine.

  5. In the Database list box, select a database.

  6. Click “…“ next to the Path text box, to select a folder to store schema export.

  7. In the Output file name text box, specify a name of the file.

  8. Optionally, you can select the Append timestamp to the file name option to add date-time parameters to the file name.

  9. Optionally, you can select the Use compression (ZIP) option to compress the script file.

  10. On the Script content page, select what you want to generate. You can also include or exclude specific database objects.

  11. On the Options page, specify how you want this wizard to generate scripts. Many different options are available.

  12. On the Error handling page, specify errors processing behavior and logging options.

  13. Click Generate.