SQL: How to generate script of database in SQL Server?

Aman Sharma
0
In this Article I will explain how to generate script of Database in SQL server.



Follow Given Steps:

1.     Open SQL server management studio. Explore Object Explorer to locate database.
  Right click on the database folderàTaskàGenerate Script


2.     New Popup will be appear, click Next Button given at the bottom:


3.     After clicking Next button new popup window will appear. In this window there will be two options
o   Script Entire databases and Database Object
o   Select Specific Database object
If you want to generate script of entire Database then select first option. If you want to generate script of specific objects such as Table or stored procedures then select second option. And press Next Button.


4.     In next popup, select path where you want to store database script:


5.     There will be a option “Advance”.  You can set advance feature from  here. Ex.
Type of Data to script: Only Data or Data with Schema Or Only Schema.

If you want to generate script of data only the select “Data only ” option.
If data and schema both then select option “Data with Schema”, if you want to generate script of structure of database object then select ”Schema only”. Then Press Next button.


6.     In next Window Summary will be appearing: you can review your selection. You can change the select by go to previous page.


7.     This will be the last step: i.e. Save or Publish Script

Database script has been created on the specified location. You can check and run that script.



Post a Comment

0Comments
Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !