Groups | Blog | Home
all groups > sql server replication > february 2007 >

sql server replication : Filtering columns in replication


MittyKom
2/6/2007 3:58:01 PM
Hi All

I have 2 tables with the same structure and data except only the data in one
of the columns, NameC. And there are on different databases.

Is it possible to replicate Db1..abc table excluding one of the columns,
NameC to Db2..abc table on a separate database without inserting anything
into the column, NameC on Db2..abc. Below is a sample of the sql to create
the scenario:
--
Create table Db1..abc (id varchar (5) PRIMARY KEY, NameC varchar(5), bid
varchar (5), MNid varchar (5))
--
Create table Db2..abc (id varchar (5) PRIMARY KEY, NameC varchar(5), bid
varchar (5), MNid varchar (5))



-- Db1..abc
Insert into Db1abc values ('1','a','a1','mna1X')
Insert into Db1..abc values ('2','b','b2','mnb2X')
Insert into Db1..abc values ('3','c','b3','mnc3X')
-- Db2..abc
Insert into Db2..abc values ('1','TestA','a1','mna1')
Insert into Db2..abc values ('2','TestB','b2','mnb2')


Before replication the tables have some records. Replication and changes
will be from Db1..abc to Db2..abc. After replication i would expect to have
DB2..abc as:

-- Db2..abc
'1','TestA','a1','mna1X'
'2','TestB','b2','mnb2X'
'3',' ','b3','mnc3X'

Take note that the column NamceC on Db2..abc did not have any inserts at
all. Is this possible? In otherwords i am inserting from 3 columns of
Db1..abc excluding the NameC column into the corresponding 3 columns of
Db2..abc excluding the NameC column.

Hilary Cotter
2/6/2007 7:14:21 PM
It sounds like what you are doing is vertical partitioning, where you are
not including the NameC column in your articles. This will work for
transactional replication if you do a no-sync subscription.

--
Hilary Cotter

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com



[quoted text, click to view]

MittyKom
2/7/2007 11:22:02 AM

Thank you Hilary. I have tried it and it seems not to work. Do you have
any link or article i can read?


[quoted text, click to view]
AddThis Social Bookmark Button