Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Restore database

Author  Topic 

manhit45
Starting Member

3 Posts

Posted - 2009-12-27 : 19:44:57
Hi guys.
I used this store procedure for backup database

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[BackUpDatabase]
AS
BACKUP DATABASE QLBH
TO DISK = 'D:\Backupdata\QLBH.Bak'
WITH FORMAT,
MEDIANAME = 'Z_SQLServerBackups',
NAME = 'Full Backup of QLBH';

How can i do similar that to restore database ?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-12-27 : 19:59:37
RESTORE DATABASE QLBH
FROM DISK = 'D:\Backupdata\QLBH.Bak'
WITH REPLACE

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

manhit45
Starting Member

3 Posts

Posted - 2009-12-27 : 20:11:56
Thanks you.
But i want to ask you.
If my database is error. I restore it. IS IT OVERWRITE OLD DATABASE OR IT CREATES NEW SIMILAR DATABASE.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-12-27 : 23:54:01
It depends on what you want.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -