views:

14

answers:

1

I have an updatable transactional replication set with SQL Server 2008. Everything is working fine. I added a new table to the existing publication thru sp_addarticle followed by sp_addsubscription. After that I ran the snapshot agent. Snapshot has been generated only for newly added table. So the new table was successfully replicated to subscriber. I could even able to replicate a newly inserted record into new table to subscriber. But vice versa is not possible. When I insert a record into new table in the subscriber database, I am getting an error

*Msg 515 'Cannot insert the value NULL into column 'msrepl_tran_version',
 table Servername.dbo.Tablename'; column does not allow nulls. INSERT fails.'*.

Please help me to resolve this issue.

Many Thanks in advance. Geeta

A: 

Is it reproducible error? Is subscriber configured as Immediate Updating? In case of Immediate Updating subscriber the transaction fails whenever publisher (or network) is unavailable.

Check and change, if it does not have it, your table so that ms_repl_tran_version defaulted to GUID:

ALTER TABLE [dbo].[TableName] ADD CONSTRAINT [DFLT_GUID_msrepl] DEFAULT (newid()) FOR [msrepl_tran_version]

vgv8
It is reproducible as I have set in test environment and subscriber is configured as immediate updating.
Geeta K.
Thanks for the solution. It works fine to insert a record in subscriber DB. However the inserted record does not get replicated back to Publisher Database.
Geeta K.