开发者

Replication from one SQL Server Express to another

开发者 https://www.devze.com 2023-04-11 20:43 出处:网络
I have one SQL Server Express instance with a pretty normal well formed database. I need to have the data continuously replicated to a SQL Server Express instance on another server.

I have one SQL Server Express instance with a pretty normal well formed database. I need to have the data continuously replicated to a SQL Server Express instance on another server.

Now, I know that SQL Server Express does not include the Publisher part of built-in replication, so I'm looking for alternative solutions. I do not want to upgrade any of the databases.

Naturally, I could make my own replication with guids, timestamps etc. and transfer the data using my own coding(as suggested in SQL Server Express database replication/synchronization), but I would want to avoid all that work, especially seeing that the replication is really very basic.

Perhaps a g开发者_StackOverflow中文版eneric trigger added to each table? Perhaps some kind of database job?

Any suggestions?


You wouldn't be able to utilize any built-in job scheduling, because Express does not ship with SQL Server Agent.

Here's your options as far as I see it:

  1. Write an application that transfers "articles" from your "publisher" db to your "subscriber" db(s)
  2. Create a set of views to have a summation of data that you want to be published. Then create INSTEAD OF triggers on these views (you can't create an AFTER/FOR trigger on a view) to process that data and transfer it to your "subscriber"(s).

Those are both not very intensive tasks. In my opinion, just to have it centralized I would go the first route. That way all of the logic is contained within the application, and your "publisher" database is ignorant to the replication. Not to mention your application could handle an unavailable subscriber pretty easy.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号