Saturday , 24 June 2017
Home » SQL » Generate copy of your database

Generate copy of your database

Generate copy of your database

Sometimes you may want to create the copy of your database structure. In order to create tables, functions stored procedures one by one in SQL Server you can generate a script that can create the same database structure for you. This is done very easy with SQL Server Management Studio.

So first you’re going to chose a database and right click on it. Go Tasks->Generate Scripts. See the picture below.

Generate copy of your database

In the following window you will have two options to choose. The first option is to script entire database and all database objects. Second is to select a specific database objects. In this tutorial I will choose the first option and script entire database and all database objects and click next. See picture below.

Generate copy of your database

In the scripting options window you can either save script on specific location or publish to a web service. You also choose where you want to save or generate the script. Here you have 3 options. Save to file, save to clipboard and save to new query window. After you’re done click next button to go to the next step.

Generate copy of your database

In the next window you see the summery of what you have chose to script. You see the source, target and options of your scripts. On source you see the server, database and selected objects. On target you see destination and in the options you see output type and where the script is going to be generated. See picture below.

Generate copy of your database

In the last window you are saving or publishing the script. Click finish to finalize the procedure.

Generate copy of your database

 

Check Also

Stored Procedure vs Functions

Stored Procedure vs Functions In this article I am going to show you the differences …

Leave a Reply

Your email address will not be published. Required fields are marked *