Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004

    Unanswered: sql server restore

    We have a database sever which is dedicated for reporting, in order to divert traffic from the OLTP database server. The OLTP db is backed up daily as part of the maintenance plan which saves the backup file in the following format: master_db_yyyymmddtttt.BAK on a network share. How would you restore the backups automatically on a daily basis to the reporting server without your intervention. Keep in mind that any existing connections to the database must be killed before the restore operation can start

  2. #2
    Join Date
    Sep 2003
    hmm, simple, just keep killing the connections in the loop until there are none left, then restore from disk='\\server\share\file.bak'

    you can also get just the latest backup by converting the date to the iso format and then xp_cmdshell 'dir ??????_db_' + reverse(substring(reverse(filename), 5, 12)) + '.BAK'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts