Mega Search
23.2 Million


Sign Up

Make a donation  
Replication Error: Cannot insert the value NULL into column  
News Group: microsoft.public.sqlserver.server

Hi All, 

I am working to setup a Transactional replication. The publisher is SQL 2005. I connect to find out that someone who had worked previously on the DB had setup the active user DB as the distribution DB. So it was under the System DB folder. 

I managed to Disable replication and was able to release the User DB which was marked as the system Distribution DB. The DB is now marked as a user DB and I ran a DBCC consistency check to ensure the DB is not corrupt. 

Then I proceed to setup replication. I am able to enable replication and was able to create new Distribution DB. When I go to add a publication from this user DB, I get the following error: 

Cannot insert the value NULL into column 'pubid', table XXXX.dbo.IHpublications column does not allow nulls. INSERT fails.

It seems its looking into this .dbo.IHpublications for some reason. It should in theory connect to distribution.dbo.IHpublications. 

I have tried everything I can in terms of dropping the distribution DB again and rebuilding it. But I see no end to this issue. 

I am wondering if anyone had seen this or have a solution for this issue. I would greatly appreciate any input or suggestions. 

Thanks In advance.. 

Regards,
Query Builder. 

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 2-Mar-2014, at 4:40 PM EST
From: Query Builder
 
Re: Replication Error: Cannot insert the value NULL into col  
News Group: microsoft.public.sqlserver.server
The Microsoft newsgroups are defunct since Microsoft them and traffic here 
is low. I usually answer questions that I see and I am able to address. 
However, this is out of my league. I would suggest that you try the MSDN 
forum for replication:
http://social.msdn.microsoft.com/Forums/sqlserver/en-
US/home?forum=sqlreplication

There may also be an appropriate forum on Stackoverflow/exchange.
-- 
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 3-Mar-2014, at 8:07 AM EST
From: Erland Sommarskog