Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
erncelen
Starting Member
15 Posts |
Posted - 2005-07-02 : 07:06:42
|
For some tables (but not all) SQL Query analyzer output the follwing message:(This happen during update)Server: Msg 2627, Level 14, State 1, Line 4Violation of PRIMARY KEY constraint 'PK_BP_STEP_LINKS'. Cannot insert duplicate key in object 'BP_STEP_LINKS'.The statement has been terminated.I have added ALTER TABLE tablename NOCHECK CONSTRAINT ALL and ALTER TABLE krna_mcocore43Import.dbo.BP_STEP_LINKS CHECK CONSTRAINT ALL at the beginning and at the end of UPDATE statementHow can I solve this problem? |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-07-02 : 07:23:35
|
| It is because you are updating that column with the value which that column already hasYou need to check the existance of the value before updating itCan you post the full update statement you used?MadhivananFailing to plan is Planning to fail |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2005-07-04 : 22:03:54
|
| are you sure you want to override the constraint?i assume, the PK was created to prevent duplicate records?solution: remove the constraint or check the value you're trying to update--------------------keeping it simple... |
 |
|
|
|
|
|