Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need clone a database to another server, but don't want any data

Status
Not open for further replies.

mm8294

MIS
Joined
Oct 12, 2001
Messages
73
Location
US
We have a database PROD on server1, and the boss asked me to clone it to server2. But, he wants only the structure and does not want any data in it.

I have done some research but could not figure out how to do it. If anybody can tell me how to do it, that would be great.

Your help is very appreciated.
 
Right click on the database that you want to clone
All Tasks==>Generate SQL Scripts
Click on Show All on General Tab
Check Scriptall Objects

Formatting Tab check everything except "Only Script 7.0 compatible feature"

Options Tab
Check all boxes

Click Ok.
This will generate a script.
Execute this on your new server


Dr. Sql
goEdeveloper@yahoo.com
Good Luck.
 
DrSql,

Thank you very much for your help. It works very well except some "Windows NT user or group XXX not found" error.

I have also tried All Task -> Export Data -> Next ... -> Copy objects and data between SQL Server databases -> uncheck "copy data", I think this is actually the same thing as the method in your post.


Thank you very much again.
 
one of the option on the last tab of the generate SQL Scripts wizard has the security info you can un check users and I there is an option for groups. this last tab is impratant as well as it allows you to opt to have Indexes scripted.

Shoot Me! Shoot Me NOW!!!
- Daffy Duck
 
MDXer, thank you for your reminding. I have checked all boxes on the last tab, but the logins on our two boxes are different, that's why I got those errors. I think I should either create the logins first or ignore those errors.
 
or uncheck script users

Shoot Me! Shoot Me NOW!!!
- Daffy Duck
 
Or you can generate a seperate script to create all users, if you need I can give you a seperate script that will generate all users in a single db.
Good luck

Dr. Sql
goEdeveloper@yahoo.com
Good Luck.
 
That would be great!

DrSql, could you send the script to xxz80@yahoo.com?



Thank you very much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top