SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Script to restore red gate backups automatically from a folder.


Script to restore red gate backups automatically from a folder.

Author
Message
newdb
newdb
SSC-Enthusiastic
SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)

Group: General Forum Members
Points: 159 Visits: 321
Thank you Sarabpreet for your response. However, I'm on SQL2000.
Also, I found a way to get the logical and physical name for the database file and the logfile.

use dbname
sp_helpfile

I'm getting close.
newdb
newdb
SSC-Enthusiastic
SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)SSC-Enthusiastic (159 reputation)

Group: General Forum Members
Points: 159 Visits: 321
Thank you Sarabpreet for your response. However, I'm on SQL2000.
Also, I found a way to get the logical and physical name for the database file and the logfile.

use dbname
sp_helpfile

I'm getting close.
SQL-DBA-01
SQL-DBA-01
SSCertifiable
SSCertifiable (7.9K reputation)SSCertifiable (7.9K reputation)SSCertifiable (7.9K reputation)SSCertifiable (7.9K reputation)SSCertifiable (7.9K reputation)SSCertifiable (7.9K reputation)SSCertifiable (7.9K reputation)SSCertifiable (7.9K reputation)

Group: General Forum Members
Points: 7924 Visits: 3548
How to include the "stats and Replace" options?




EXECUTE master..sqlbackup '-SQL
"RESTORE DATABASE [ABCD] FROM DISK = ''D:\backup\file.sqb''
WITH RECOVERY
, MOVE ''abc_1'' TO ''F:\MSSQL\Data\as.mdf''
, MOVE ''abc_1_log'' TO ''G:\MSSQL\Logs\2_log.ldf''"'
--, Stats = 10
--, Replace'





Thanks.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search