How to generate SQL Server database scripts

With the help of the Generate Scripts Wizard in dbForge Schema Compare for SQL Server, you can create scripts to migrate database structure, data, or both from one instance of SQL Server or Azure SQL to another.

Note

The server to which you wish to transfer the database must contain a database that shares the exact same name as the one being transferred.

The logic of the process includes such steps:

1. Generate scripts, for example, for the whole database on one server.

2. Connect to the server where you want to deploy this database.

3. Run the generated scripts.

It’s possible to generate scripts for a database located on a local database, a remote SQL Server database, and a database on Microsoft Azure SQL Database.

Generate a script

1. In dbForge Schema Compare, navigate to Database > Tasks, and then click Generate Scripts.

2. If you have already had the generated *.backup file, click Open to select it. If you do not have it, skip this step.

Open file

3. Choose the required server and database.

Required connection

4. Specify the path to save the file containing the generated scripts by clicking three dots.

Path for the file

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

6. Optionally, you can select:

  • Append timestamp to the file name option to add date-time parameters to the file name.
  • Use compression (ZIP) option to compress the file.

7. Click Next and on the Script content page, select what you want to migrate. You can also include or exclude specific database objects.

Migration objects

8. Proceed to the next step and on the Options page, specify your preferred settings for the script generation process.

9. Click Next and on the Error handling page, specify errors processing behavior and logging options.

10. Finally, click Generate. The scripts generation process will start.

Scripts generation process

11. If you want to open the file with the generated scripts, select Open script and click Finish.

Finish

The file will be opened in dbForge Schema Compare.

Opened file

Want to Find out More?

Overview

Overview

Take a quick tour to learn all about the key benefits delivered by dbForge Schema Compare for SQL Server.
All Features

All features

Get acquainted with the rich features and capabilities of the Schema Compare in less than 5 minutes.
Request a demo

Request a demo

If you consider employing the Schema Compare for your business, request a demo to see it in action.
Ready to start using dbForge Schema Compare for SQL Server?