Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Restore .bak into a different name?
Message
De
26/08/2017 15:51:34
 
 
À
26/08/2017 10:20:04
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Copies de sauvegarde
Divers
Thread ID:
01653769
Message ID:
01653775
Vues:
35
>I made a backup of a customer SQL Server database (my app database) into a .BAK file.
>I then copied this .BAK file to my computer, into my SQL Server database backup folder.
>Now I want to restore this .BAK into my SQL Server but since I already have a DB of the same name, I want to restore it into a different name. E.g. the name of the DB in my SQL Server is MyAppDb and I want to restore the .BAK into MyAppDbCurrent.
>I open/connect my SQL Server 2016 SSMS. I go to the Restore window and specify Destination as MyAppDbCurrent and then select the .BAK file as restore from. But the Restore of the DB fails. Is this because the database name (in .BAK) is MyAppDb (the same as one of my existing databases). How would I resolve it?

Here is an example to customize the restore:
USE Master
RESTORE DATABASE [LevelExtreme] FROM DISK = N'D:\Data\Level Extreme\LevelExtreme.bak'
 WITH
 MOVE 'UniversalThread' TO 'D:\Data\Level Extreme\LevelExtreme.mdf',
 MOVE 'UniversalThread_log' TO 'D:\Data\Level Extreme\LevelExtreme.ldf',
 FILE = 1,  NOUNLOAD,  REPLACE,  STATS = 10
GO
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform