April 24, 2006 at 10:48 am
I just inherited a system that uses merge replication, I am trying to insert some rows into a table that is replicated and I am getting the following error.
Server: Msg 515, Level 16, State 2, Line 1
Cannot insert the value NULL into column 'directoryId', table 'MMSMail.dbo.DirectoryHierarchy'; column does not allow nulls. INSERT fails.
The statement has been terminated.
Here is the inset statement:
Insert into DirectoryHierarchy(ParentDN,RDN,Type)
select ParentDN, (FirstName + ' ' + LastName) as RDN, 3 from tempmms where directoryid is null and MMSAction = 'I'
go
I am not familar with merge replication. I need to insert about 13,000 rows into multiple tables. How do I deal with the uniqueidentifer row? I would appreciate any help.
April 24, 2006 at 12:13 pm
If the Unique Identifier column does not allow nulls, you need to insert a value.
Insert into DirectoryHierarchy(directoryId,ParentDN,RDN,Type)
select NEWID() as DirectoryID, ParentDN, (FirstName + ' ' + LastName) as RDN, 3 from tempmms where directoryid is null and MMSAction = 'I'
April 25, 2006 at 11:20 am
Thanks alot!! that did the trick.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply