SQL Server msrepl_tran_version inserts fail
Posted on 2010-09-08
I have recently set up a replication with updatable subscribers on a couple of remote SQL Server DB's. The column msrepl_tran_version was auto created in all my tables. Inserts fail on some tables, while they go right through on others.
The failures in Management Studio generate...
Cannot insert the value NULL into column 'msrepl_tran_version' table [TABLE NAME]; column does not allow nulls. INSERT fails.
The same query being run through an ASP document produces...
Column name or number of supplied values does not match table definition
I am able to get the inserts to go through if I explicitly list the msrepl_tran_version column and insert (newid()) as the value, but this is not a good solution as I would have to go through thousands of lines of code and add it to each and every query. I'm hoping to find a DB level solution.
The one thing I notice between a couple tables that fail, and the one that works, is that the working one has an identity (auto incrementing) primary key column. Could this have anything to do with the problem on the others? Any other suggestions as to how to fix the issue?