Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / database / SQL-Server

Generate script from Microsoft SQL Server Management Studio

4.80/5 (2 votes)
25 Oct 2013CPOL1 min read 10.1K  
Generate script from Microsoft SQL Server Management Studio.

From Microsoft SQL Server Management Studio right click on database,  a pop up menu will appear.  From popup menu select tasks > Generate Scripts. A new dialog box called Generate and Publish Scripts window will appear. This window will look like below picture.

GenerateScript_1

From this window click on next button. Choose Objects option will appear like below picture.

GenerateScript_2

Now you can either generate script for all database objects or specific object. To do this just select one option.  If you select “Select specific database objects” then you have to select the objects from list.

Now click on next button. Set scripting options will appear like below picture.

GenerateScript_3

We will save the script to a specific location, that’s way select first option. choose the file name. Now click on Advanced button. A new window will appear like below picture.

GenerateScript_4

select “schema and data” option of Types of data to script. This will generate the schema as well data. Click on OK button. Click on next button and review your selection. Then once again click on next button and it will start to generate the script. After generate script just click on Finish button.

Job done.

The post Generate script from Microsoft SQL Server Management Studio appeared first on crea8ivecode.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)