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 |
jbates99
Constraint Violating Yak Guru
396 Posts |
Posted - 2014-05-29 : 19:38:23
|
Hi all,(I know there is a forum specifically for Replication but it seems to not be very active)My question is: Is it possible to use Transactional Replication on a table that has a Foreign Key? It has a Primary key but also a couple of foreign keys. (This is 2008 R2)Thanks, Jack |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-05-29 : 19:41:29
|
Yes. We don't copy the foreign keys to the subscriber, but you can if you want to. The only issue if you have multiple publications sending the data to the same subscriber, and the related tables are split up amongst those publications. You could run into FK issues in that case. You get around that by not adding the FKs to the subscriber, though this could cause "bad" data. The way around the entire thing is to have one publication for a set of related tables.Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
jbates99
Constraint Violating Yak Guru
396 Posts |
Posted - 2014-05-29 : 21:36:02
|
Thank you, thank you Tara!This is wonderful news. Obviously, I have not tried it yet. I will have only 1 publication and 1 subscriber for these tables. Can't wait to try this tomorrow!Jack |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|