I am replicating several tables to a database on the same server as the source database.
Those tables have several foreign keys between them. When I look at the replicated tables, they do not have the foreign keys on them.
So, here are my questions:
NOTE:
My source database has TableA
and TableB
. TableA
has a primary key of AId
. TableB
has a foreign key on that column. And I am doing a transactional replication of both TableA
and TableB
.
OK, I came across something, but it would depend on what type of replication you are using.
I am using transactional replcation. Find the publication you are using here,
(Management Studio) Replication -> Local Publications -> (Publication)
Right click the publication and select properties, then under articles right click 'Tables' and select the option 'Set Properties of All Table Articles'.
In there the first item is 'Copy foreign key constraints'.
Haven't tried it, but I expect it to work.
You can apply these settings per table too if you right click a single table and select the option 'Set Properties of This Table Article'.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With