This is the sql Generated by Sql management studio:
RESTORE DATABASE [DatabaseName] FROM DISK = N'C:\temp\db\DBBackup.bak' WITH FILE = 1, NOUNLOAD, STATS = 10 GOUnfortunately it running it couses an error: Error 3154: The backup set holds a backup of a database other than the existing database.
All you need to do is to add parameter REPLACE. this is how new query looks like:
RESTORE DATABASE [DatabaseName] FROM DISK = N'C:\temp\db\DBBackup.bak' WITH REPLACE, FILE = 1, NOUNLOAD, STATS = 10 GO
Brak komentarzy:
Prześlij komentarz