Use SQL Server Agent and create a job with 3 steps:
- Backup local database
- Copy .bak file to remote server
- Restore .bak to remote server
Question
I am just looking for some advice here as I am quite new to this. I have a client who requires a local copy of a SQL database and the same database running on a remote server. the remote database is only kept as a backup and needs to be updated usign the information from the local database nightly.
What would be the best solution for this. Should I write a C# application to copy the database accross to the live server nightly or does SQL server has something that we can use? If it is C# application do I need to use bulkcopy? would that also copy over the rows that has been changed or updated as well?
Any help would be greatly appriciated.
Solution
Use SQL Server Agent and create a job with 3 steps:
OTHER TIPS
does it need to be an exact copy? Why not blow away the tables each night on the backup and bulkcopy them over on a schedule?
You can also use tools like Redgate SQL Comparison SDK to schedule schema and data changes and be done with
Here are couple options you can try:
How big are these updates? If this is something that doesn’t involve too much updates you might be able to do that with linked server and a bit more sophisticated queries.