SQL Server Central is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
Search:  
 
 

Restore last backup to a different server/database

By Cyanide, 2003/03/31

Total article views: 278 | Views in the last 30 days: 9

Finds the last available backup for a specified database (local or remote server), then restores the backup onto an existing database on the local server.
The script will kill all non-system processes in the destination database to allow the script to be scheduled at night regardless is anyone is still connected.
The logical and physical names are preserved incase of non-standard data and log file suffixes.

I wrote this script as the developers I work with are constantly asking for copies of live databases onto testing servers.

It has been tested on multiple servers in my environment.
The source server must be a linked server to the current server to allow the script to find the last backup details.
The script also relies on the standard administrative shares to access the backupfile, so the login context must have administrative access to the source server.

By Cyanide, 2003/03/31

Total article views: 278 | Views in the last 30 days: 9
Your response
 
 
Related tags
 
Like this? Try these...
Already registered?  

Free registration required

To read the rest of this article, and access thousands of other articles, we ask you to register on the site and subscribe to our newsletters.

Register

E-mail address:
Password:
Password (confirm):

  

Subscriptions

We ask you to register on the site and subscribe to our newsletters. Subscribing to our newsletters gets you:

  • ALL of our content (thousands of articles, scripts, and forum postings)
  • A daily newsletter (example)
  • A weekly news round up (example)
  • The opportunity to ask and answer questions in our forums
  • A daily Question of the Day to test and help you increase your knowledge of SQL Server.

We ask that you give the newsletter a try for a week. Over 200,000 SQL Server Professionals a day find it entertaining and useful. If not, you are welcome to unsubscribe at anytime.

Steve Jones
Editor, SQLServerCentral.com