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.
Author |
Topic |
sunny_10
Yak Posting Veteran
72 Posts |
Posted - 2013-03-14 : 01:38:04
|
Hi How i can restore database using Stored ProcedureThanks |
|
ScottPletcher
Aged Yak Warrior
550 Posts |
Posted - 2013-03-14 : 12:48:41
|
You can use a RESTORE DATABASE command inside the stored proc:CREATE PROCEDURE ......SET @db_name_to_restore = ...SET @backup_file_to_restore = 'x:\full\path\to\backup\file\backup.bak'RESTORE DATABASE @db_name_to_restoreFROM DISK = @backup_file_to_restore |
 |
|
|
|
|