[dba-SQLServer] Duplicate a Database

Dan Waters dwaters at usinternet.com
Mon Aug 4 12:51:59 CDT 2008


Great!!!

I was able to just use the GUI in Management Studio to do this in 2 minutes.

Thanks again!
Dan

-----Original Message-----
From: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Asger Blond
Sent: Monday, August 04, 2008 12:42 PM
To: 'Discussion concerning MS SQL Server'
Subject: Re: [dba-SQLServer] Duplicate a Database

Dan,
One way is to make a backup followed by a restore using WITH MOVE - i.e.:

BACKUP DATABASE MyDatabase 
TO DISK='C:\MyBackupFolder\MyDatabase.bak'
GO
RESTORE DATABASE MyDuplicateDatabase 
FROM  DISK = 'C:\MyBackupFolder\MyDatabase.bak' 
WITH  MOVE 'MyDatabase_Data' 
TO 'C:\MyDataFolder\ MyDuplicateDatabase.mdf',  
MOVE 'MyDatabase_Log' TO 'C:\MyDataFolder\ MyDuplicateDatabase.ldf'
GO

Asger
-----Oprindelig meddelelse-----
Fra: dba-sqlserver-bounces at databaseadvisors.com
[mailto:dba-sqlserver-bounces at databaseadvisors.com] På vegne af Dan Waters
Sendt: 4. august 2008 18:45
Til: SQL Server List
Emne: [dba-SQLServer] Duplicate a Database

I'm using SQL Express, and have one database.  I'd like to duplicate that
database inside the same SQL instance and give the duplicate a different
name.

Within Management Studio, I can't see how to do that.

Is this possible?

Dan


_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com



_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com





More information about the dba-SQLServer mailing list