Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Replication (2005)
 Replication and Computed columns

Author  Topic 

Pim75
Starting Member

2 Posts

Posted - 2009-12-10 : 08:48:49
Hello,

I've setup a replication between two SQL2005 servers.

In the Publication database there's a computed column that holds a result of two other columns. Computed Column is Persisted and formula is [field1]+[field2]. The two dependant fields [field1] and [field2] are also in the replication set.

I wonder what happens when I replicate this field to the Subscriber. Will all the data in the Computed field be replicated, or only the formula? This is important to me, because I want to keep the replicated data to a minimum.

I hope someone can give me some clear information on this.
Thanks in advance!

Pim

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2009-12-10 : 09:35:25
neither. you don't insert into computed columns. the table definition should be the same on the subscriber as on the publisher.
Go to Top of Page

Pim75
Starting Member

2 Posts

Posted - 2009-12-10 : 09:54:46
Thanks for your reply.

So as I understand only the formula is replicated, not the data? I wondered about this, because the colums is Persisted (data is saved on the server).
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2009-12-10 : 11:57:05
Well, the formula is part of the table definition:

Create Table aTable (
a int,
b int,
c as (a + b)
)

So changes to a and b are replicated and the computation occurs on the subscriber for c as well as on the publisher.
Go to Top of Page
   

- Advertisement -