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
 Old Forums
 CLOSED - General SQL Server
 Create A Duplicate Database Without Enteprise Mngr

Author  Topic 

SketchySteve
Starting Member

4 Posts

Posted - 2005-09-21 : 07:18:44
Hi There,

I was wondering if there was a simple way of create a duplicate of an entire database.

I often need to create a second copy of a database for development purposes. I have lost the use of Enterprise Manager which I can no longer simply script the database and then use dts to move the data across.

Is there a way of doing this in T-SQL?


Thanks

Steve

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-09-21 : 07:26:34
Take a backup and restore it

Backup Database DBName to disk='C:\DBname.bak'

and restore it in Test Environment

Create Database DBName
Restore Database DBName from disk='C:\DBname.bak'



Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

SketchySteve
Starting Member

4 Posts

Posted - 2005-09-21 : 08:24:28
Thanks for that madhivanan,

The database does not sit on one of our servers but did the backup command and then just sent em an email to get hold of it. Got the job done nicely.

Cheers!
Go to Top of Page
   

- Advertisement -