Answers for "sql server restore database"

SQL
1

sql server restore database

--Step 1: Check the logical file names with the help of the following command:

  RESTORE FILELISTONLY 
  FROM DISK = 'E:\DBBackups\mydb.bak'

--Step 2: Use the logical names you get from the above query in the below query:

  RESTORE DATABASE [mydb_new]
  FILE = N'<MDFLogicalName>' 
  FROM DISK = N'E:\DBBackups\mydb.bak'
  WITH FILE = 1
	  ,NOUNLOAD
	  ,STATS = 10
	  ,MOVE N'<MDFLogicalname>' TO N'E:\DBBackups\mydb_new.mdf'
	  ,MOVE N'<LDFLogicalName>' TO N'E:\DBBackups\mydb_new_0.ldf'
Posted by: Guest on March-04-2021

Code answers related to "sql server restore database"

Code answers related to "SQL"

Browse Popular Code Answers by Language