question

rehaan avatar image
rehaan asked

How to increase size of a column in a table a subscriber in transactional replication

0 Hi friends, I am working on Transactional Replication. I have requirement to increase the size of a column for few tables at subscriber then I will encrypt it with guid At publisher create table test (col1 varchar(20), col2 varchar(20)) At subscriber Create table test (col1 varchar(100),col2 varchar(100)) I want to increase the size of datatype at subscriber and then add some custom logic to the column for which am increasing the size in the sproc CALL [sp_MSins_dbotest] I want to apply snapshot with this change. How can i do this. Any help would be much appreciated
replication
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
sjimmo avatar image
sjimmo answered
I do not believe that you can do this at the subscriber. You can change the size of a field at the publisher, and have that replicated. You could then apply your logic on the subscriber. BUT - (yes, there is always a but) if you ever reinitialize the subscription all of your logic will go away.
2 comments
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Yes.. I can apply logic on subscriber. but when snapshot is generated all the data is replicated to subscriber. I can now add the logic to subscriber. data after this change will be replicated as I need, but how about the data which is already replicated. I don't want to change this manually. so my question is can I do this before snapshot
0 Likes 0 ·
What you are looking to do is to create your publication and have it not drop and create a new table on reinitialization. In this way you can do as you are looking to do. When the subscription is reinitialized, the table will not be dropped and re-created. But remember, if you add a new subscriber that you will have to add all of these changes on the subscriber side if needed.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.