SQL Script to restore MSSql 2005 Database

Hi All
I'm looking for a script that will restore (and overwrite) Ms sql server 2005 database from backup file. Basically I've got two identical databases in two location (one works as backup) and I transfer backup files over night and restore them next day. It would be nice to have a script that will restore them automatically.

Please advise
fortresAsked:
Who is Participating?
 
Raja Jegan RConnect With a Mentor SQL Server DBA & ArchitectCommented:
<< and I transfer backup files over night and restore them next day. >>

If you would be doing the file transfer then if you specify a standard file name for the backup file, then you can

1. Save the script provided above as a *.sql file
2. Using Windows scheduler you can execute this sql file using SQLCMD scripts.

Automation is done.
0
 
Raja Jegan RSQL Server DBA & ArchitectCommented:
0
 
fortresAuthor Commented:
Thanks for advise - I did as you said rrjegan17 but intead of windows scheduler I've used SQL server Agent and it also works fine -thanks again
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.