How To Backup and Restore Secured Back Up File in SQL SERVER

Jeetu_choudhary12
Posted by Jeetu_choudhary12 under Sql Server category on | Points: 40 | Views : 1494
--Let suppose we have database and we want to make secured backup,
--If we can do it by the Given below command. We have database named Sample.

BACKUP DATABASE Sample TO DISK='C:\Sample.BAK' WITH PASSWORD='jeetu'

--Now Given Below Command will Restore the Backup File. Make sure that
--the another Server should have Same name DATABASE otherwise Create New DATABASE in which Server You want to Restore AS given Below:

create database Sample

RESTORE DATABASE Sample
FROM DISK = 'C:\Sample.BAK'
WITH REPLACE,
MOVE 'Sample' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\Sample.MDF',
MOVE 'Sample_Log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\Sample_Log.LDF',
password = 'jeetu'

Comments or Responses

Posted by: T.saravanan on: 9/12/2011 Level:Silver | Status: [Member] [MVP] | Points: 10
Kindly post your code inside the code tag.

Login to post response