How can we help you today? How can we help you today?

Can Backup 5 restore to new database?

Is there a way to restore to a new - or even a different - database using SQL Backup 5?
mrn242
0

Comments

1 comment

  • petey
    Yes. If you want to use the same database files as the original database, omit the MOVE options e.g.
    EXEC master..sqlbackup '-sql "RESTORE DATABASE AdventureWorks_copy FROM DISK = [g:\backups\AdventureWorks.sqb]"'
    
    If you want to create new database files, use the MOVE options e.g.
    EXEC master..sqlbackup '-sql "RESTORE DATABASE AdventureWorks_copy FROM DISK = [g:\backups\AdventureWorks.sqb] WITH MOVE [AdventureWorks_dat] TO [e:\sqldata\AdventureWorks_copy.mdf], MOVE [AdventureWorks_log] to [e:\sqldata\AdventureWorks_copy.ldf]"'
    
    petey
    0

Add comment

Please sign in to leave a comment.