Tuesday 6 September 2011

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

--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 sunil TO DISK='C:\sunil.BAK' WITH PASSWORD='jeetu'

--Now Given Below Command will Restore the Backup File. Make sure that
-- the another Server should have Same name DATABASE other Create New DATABASE AS given Below:

create database sunil

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

No comments:

Post a Comment