MSSQL Generate script to create a database schema only

I want to duplicate my database schema, but I do not want to copy the data contents. There are 3rd party tools which I can use to achieve the same result. But I prefer to use the Microsoft SQL Server Management Studio.

To do so:

1.) Open Microsoft SQL Server Management Studio

2.) Example we have a database named Anime:
  a.) Right click on it -> Task -> Generate Scripts

3.) Introduction tab, click next

4.) Choose Objects tab, choose specific database objects, Select All, then unclick users. (I don't usually include users when backing up the schema)

5.) Set Scripting Options tab, change the "File name", to your desired location and file. Click Advanced.
  a.) Options window, select SQL Server 2005 (since that's my current version)
  b.) Type of Data to Script: Schema Only. Here you can choose Schema and Data if you like
  c.) Click ok and then Next


6.) Review the Generate and Publish window, click Next then Finish
MSSQL Generate script to create a database schema only MSSQL Generate script to create a database schema only Reviewed by Edward Legaspi on Tuesday, December 14, 2010 Rating: 5

No comments:

Powered by Blogger.