Tag: sql server query clone copy database script

SQL Server: Clone a database with all its objects

A previous post covered the steps to copy table structure and data to a new or existing database.

To copy all the objects (tables, users, constraints, etc.) from one SQL Server database to another database, use the Generate Scripts function in SQL Server Management Studio.

  1. In the Object Explorer, right click the name of the database. Select Tasks > Generate Scripts…


  2. The Script Wizard will open. Click Next.


  3. Select the source database. If you want to copy ALL objects, make sure Script all objects in the selected database is checked. If the box is not checked, you will get a chance to choose the objects you want to include later.

    Click Next.


Continue reading