Let's say I have the following scenario:
One table Item , referenced (twice) by another table Item_Link , on item_id and linked _item_id
I want to make sure that rows in table item_link only get to the subscriber when both parents exist in table Item.
Creating one join filter is easy, now creating two is different matter all together.
Is there another way of replicating this apart from adding the content of the second join filter in the subset filter of the table with an exist type clause ? I read the warnings about how this must not be done but are there any other solutions ?
Here is the code for my tables and publication:
CREATE TABLE item (
item_id INT PRIMARY KEY ,
item_desc VARCHAR(10),
hn SYSNAME DEFAULT (HOST_NAME()), -- used for filtering by subscriber
rowguid UNIQUEIDENTIFIER ROWGUIDCOL
)
CREATE TABLE item_link (
link_id INT IDENTITY primary KEY,
item_id INT NOT NULL REFERENCES item (item_id) NOT FOR REPLICATION ,
linked_item_id INT NOT NULL REFERENCES item(item_id) NOT FOR REPLICATION,
rowguid UNIQUEIDENTIFIER ROWGUIDCOL
)