|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Server: Msg 2627, ...Violation of PRIMARY KEY constraintWhen I try to update a table I receive the following message
Server: Msg 2627, Level 14, State 1, Line 1 Violation of PRIMARY KEY constraint 'PK_BP_STEP_LINKS'. Cannot insert duplicate key in object 'BP_STEP_LINKS'. The statement has been terminated. I have set NOCHECK CONSTRAINT ALL before executing the statement But for other table not.... Who can suggest me how to solve the problem The Books Online states that NOCHECK applies only to FOREIGN KEY and CHECK
constraints. When updating primary key columns or inserting new rows, the new values must not already exist in the table -- Show quoteHope this helps. Dan Guzman SQL Server MVP "erncelen" <ernce***@discussions.microsoft.com> wrote in message news:E6FB8543-D33B-4554-A1D9-9EEBDC59BB85@microsoft.com... > When I try to update a table I receive the following message > > Server: Msg 2627, Level 14, State 1, Line 1 > Violation of PRIMARY KEY constraint 'PK_BP_STEP_LINKS'. Cannot insert > duplicate key in object 'BP_STEP_LINKS'. > The statement has been terminated. > > > I have set NOCHECK CONSTRAINT ALL before executing the statement > > But for other table not.... > > Who can suggest me how to solve the problem > Exactly how did you set this? Why would you want to have a table with
duplicate PK's on purpose? Either it is a PK or it is not. -- Show quoteAndrew J. Kelly SQL MVP "erncelen" <ernce***@discussions.microsoft.com> wrote in message news:E6FB8543-D33B-4554-A1D9-9EEBDC59BB85@microsoft.com... > When I try to update a table I receive the following message > > Server: Msg 2627, Level 14, State 1, Line 1 > Violation of PRIMARY KEY constraint 'PK_BP_STEP_LINKS'. Cannot insert > duplicate key in object 'BP_STEP_LINKS'. > The statement has been terminated. > > > I have set NOCHECK CONSTRAINT ALL before executing the statement > > But for other table not.... > > Who can suggest me how to solve the problem >
Other interesting topics
|
|||||||||||||||||||||||