Anyone have a SQL script/job/etc that...

Anyone have a SQL script/job/etc that...

 

  

I figure this is the perfect list to ask if anyone has a script/job/etc. that
will restore a database from a backup file to another server. So, in the act
of being lazy, does anyone have any scripts/jobs/etc. handy that can do this?


What I want to do is refresh a test environment from production backups on a
scheduled basis. Currently I do this manually, but I'm getting tired of this
process and would rather script it into a job. Instead of taking the time to
create this script myself initially (unless of course I have to), I thought
I'd ask you guys first. Here are circumstances that may or may not be of use
to those of you thinking that you may have something handy for me.

1. Restoring from SQL 2000 backups generated via maintenance plans
(which means a changing backup file name)
2. Backups stored on network drive accessed via UNC file path
3. Backups located in Backup/Subdirectories
4. Restoring to a SQL 2000 database server
5. Database Names and will need to be changed
6. Data and Log file paths will need to be changed
7. Must run some custom SQL scripts after restore operations are
complete

If anyone has anything they'd like to pass along I'd appreciate it.

Thanks everyone,

John Eisbrener
SQL Database Administrator
Capitol Insurance Companies




MS Sql Server LazyDBA home page