简体   繁体   中英

Sql database copy from one server to another server

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.

Use SQL Server Agent and create a job with 3 steps:

  1. Backup local database
  2. Copy .bak file to remote server
  3. Restore .bak to remote server

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?

您还可以使用Redgate SQL比较SDK之类的工具来计划架构和数据更改,并通过

Here are couple options you can try:

  • SQL Server Agent job or a simple bat or powershell script that will backup, copy and restore database at the same time every day
  • Third party tools such as Red Gates comparison SDK or ApexSQL Diff API

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM