views:

34

answers:

2

Hi,

I am trying to get the content of one MSSQL database to a second MSSQL database. There is no conflict management required, no schema updating. It is just a plain copy and replace data. The data of the destination database would be overwritten, in case somebody would have had changed something there.

Obviously, there are many ways to do that

  • SQL Server Replication: Well established, but using old protocols. Besides that, a lot of developers keep telling me that the devil is in the details and the replication might not always work as expected and that is this best choice for an administrator, but not for a developer.
  • MS Sync Framework: MSF is said to be the cool, new technology. Yes, it is this new stuff, you love to get, because it sounds so innovative. There is the generic approach for synchronisation, this sounds like: Learn one technology and how to integrate data source, you will never have to learn how to develop syncing again. But on the other hand, you can read that the main usage scenario seems to be to synchronize MSSQL Compact databases with MSSQL.
  • SQL Server Integration Services: This sounds like an emergency plannable solution. In case the firewall is not working, we have a package that can be executed again and again... until the firewall drops down or the authentication is fixed.
  • Brute Force copy and replace of database files: Probably not the best choice.

Of course, when looking on the Microsoft websites, I read that every technology (apart from brute force of course) is said to be a solid solution that can be applied in many scenarios. But that is, of course, not the stuff I wanted to hear.

So what is your opinion about this? Which technology would you suggest.

Thank you!

Stefan

+1  A: 

I'd add two techniques to your list.

  • Write T-SQL scripts to INSERT...SELECT the data directly
  • Create a full backup of the database and restore it onto the new server

If it's a big database and you're not going to be doing this too often, then I'd go for the backup and restore option. It does most of the work for you and is guaranteed to copy all the objects.

I've not heard of anyone using Sync Framework, so I'd be interested to hear if anyone has used it successfully.

Paul Spangle
We use nightly full/differential restores for a lot of our "reporting" scenarios like this.
BradC
+1  A: 

The easiest mechanism is log shipping. The primary server can put the log backups on any UNC path, and then you can use any file sync tools to manage getting the logs from one server to another. The subscriber just automatically restores any transaction log backups it finds in its local folder. This automatically handles not just data, but schema changes too.

The subscriber will be read-only, but that's exactly what you want - otherwise, if someone can update records on the subscriber, you're going to be in a world of hurt.

Brent Ozar
Hey Brent, how comes I have more reputation but you have more badges ;) This is not fair!
AlexKuznetsov
Do you know which editions of SQL Server support log shipping? It used to be only Enterprise edition, and I thought I'd heard it was now available on all editions, but I can't find any links to support that.
Paul Spangle
"Support" for log shipping is a load of hooey. You can do it with T-SQL scripts on any edition, so Microsoft wised up and made it a supported feature of Standard too.
Brent Ozar