Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
naegelbe
Starting Member
2 Posts |
Posted - 2006-05-12 : 04:46:00
|
HelloI need to synchronise 2 SQL Server databases from 2 independant network.So I make first A backup for each user databases and in second, I need to make an automatic restore from backup files (*.bak).How can I do this ?Is there available scripts to do this ?Thanks a lot. |
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-05-12 : 05:00:20
|
look at restore database in bol.This will do it for youhttp://www.nigelrivett.net/SQLAdmin/s_TestRestore.html==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
naegelbe
Starting Member
2 Posts |
Posted - 2006-05-12 : 05:36:19
|
Thanks a lot.I will try this. |
 |
|
DMcCallie
Yak Posting Veteran
62 Posts |
Posted - 2006-05-12 : 10:50:09
|
Here you go: This does a DB disk backup then restores the DB backup over a different DB:/* Backup Grouping DB to Disk 5/04/06 TDM */BACKUP DATABASE [Grouping] TO DISK = N'E:\Program Files\Microsoft SQL Server\MSSQL\Database Backups\Grouping.bak' WITH NOFORMAT, INIT, NAME = N'Grouping Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10GO/* Restore Grouping DB Backup to Migration */RESTORE DATABASE [Migration] FROM DISK = N'E:\Program Files\Microsoft SQL Server\MSSQL\Database Backups\Grouping.bak' WITH FILE = 1, MOVE N'Grouping_Data' TO N'E:\Program Files\Microsoft SQL Server\MSSQL\data\Migration_Data.mdf', MOVE N'Grouping_Log' TO N'F:\Program Files\Microsoft SQL Server\MSSQL\data\Migration_log.ldf', NOUNLOAD, REPLACE, STATS = 10GO |
 |
|
Kristen
Test
22859 Posts |
|
DMcCallie
Yak Posting Veteran
62 Posts |
Posted - 2006-05-12 : 15:40:17
|
Yes in my example the names are explicitly defined; however, I was just showing an example of a working backup and restore command syntax...DeWayne |
 |
|
|
|
|
|
|