0

Using Merge Replication, I have a table that for the most part is synchronized normally. However, the table contains one column is used to store temporary, client-side data which is only meaningfully edited and used on the client, and which I don't have any desire to have replicated back to the server. For example:

CREATE TABLE MyTable (
    ID           UNIQUEIDENTIFIER NOT NULL PRIMARY KEY,
    Name         NVARCHAR(200),
    ClientCode   NVARCHAR(100)
)

In this case, even if subscribers make changes to the ClientCode column in the table, I don't want those changes getting back to the server. Does Merge Replication offer any means to accomplish this?

An alternate approach, which I may fall back on, would be to publish an additional table, and configure it to be "Download-only to subscriber, allow subscriber changes", and then reference MyTable.ID in that table, along with the ClientCode. But I'd rather not have to publish an additional table if I don't absolutely need to.

Thanks,

-Dan

user1228457
  • 99
  • 1
  • 5

1 Answers1

0

Yes, when you create the article in the publication, don't include this column. Then, create a script that adds this column back to the table, and in the publication properties, under snapshot, specify that this script executes after the snapshot is applied.

This means that the column will exist on both the publisher and subscriber, but will be entirely ignored by replication. Of course, you can only use this technique if the column(s) to ignore are nullable.

Damien_The_Unbeliever
  • 234,701
  • 27
  • 340
  • 448