Wednesday, December 26, 2012

how to create structure of database in sqlserver

Creating other database structure using existing data base using sqlserver is pretty simple compare to other.As you can see the below image ,the existing data base is appeared in sql server.In this example the existing  DB has 15 tables .Now i will place the same structure in to other DB.

To create structure we need to create a script for existing database.For this we have to select the generate script option.Then we can create script as in below


 
 To create a nee DB with this query we need to update the database name with desired DB name.Here i have changed to TestDB1.
                                      

 



Here you can observe the structure of the new database (TestDB1) which is complely similar to the structure of  existing one

No comments:

Bel