Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How do I create a copy of a sql database?

Author  Topic 

Goalie35
Yak Posting Veteran

81 Posts

Posted - 2010-02-02 : 02:15:03
Hello.

I need to create a copy of my database (sql server 2005) that I can allow someone else to download off of my web server & install the copy on their local machine.

What do I need to do in order to do this?

Thanks.

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2010-02-02 : 02:19:12
Take a full backup, zip it and link it from your website. If you don't want to share the data just create a script using the wizard in management studio: Right-click the database you want to publish -> Tasks -> Generate script

- Lumbago
If the facts don't fit the theory, change the facts. Albert Einstein
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-02-02 : 02:38:52
You could also DETACH the database, Zip up the MDF and LDF files, and put that on your website. But my preference would be a Backup file too.

Make sure the "empty" database is not too big when you back it up - it will restore to the same initial size (100GB might be a surprise for the new owner!). (Same is true of DETACH method of course)
Go to Top of Page
   

- Advertisement -