views:

210

answers:

3

Possible Duplicate:
Backup SQL Schema Only?

Hi Anybody tell how to take sql database backup without data. i wanted to take all the tables and structures from sql server 2008. and import to another sql server 2008. i dont need the data.

Appreciate your help

Regards Joseph

+11  A: 

Use "tasks" -> "Generate scripts" and choose what you want to script. Run, save to a file, open the file against the new database and run the script after changing the database name to match (if it changed)

Otávio Décio
+1  A: 

You can do this by making scripts. The way to go is:

  • Right click the table you want to script to the other database.
  • Script table as: -> Create to New query window.
Younes
dear Younes. thanks. but I have more 300 tables and many procedured s and functions.
Joseph
I guess the answer above me suites you best then hehe.
Younes
+1  A: 

First time you can use the script database option, as Otavio suggested.

Subsequent times you can use a tool like RedGate SQL Compare or the Compare Schema functionality of Visual Studio Database Edition. These tools allow you to synch schema (ie. 'table structure') from one database to another.

Remus Rusanu
Remus, you can use SQL Compare the first time just as well. Create an empty database, compare it against yours, maybe play with settings to have the script less verbose (no transactions)
AlexKuznetsov
Sure you can, is just a problem of cost since neither RedGate's tool nor VSTS DB are free.
Remus Rusanu
Dear Thanks for your suggetions
Joseph