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.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Simple Update Statement Getting an Error

Author  Topic 

dtrivedi
Posting Yak Master

153 Posts

Posted - 2010-10-19 : 10:40:58
I'm running a simple update statement but am getting this error. I don't know exatcly what it means

Msg 2627, Level 14, State 1, Line 1
Violation of PRIMARY KEY constraint 'PK_TBLPOSX00'. Cannot insert duplicate key in object 'dbo.TBLPOSX00'.
The statement has been terminated.



UPDATE TBLPOSX00 SET COMPANY=1 WHERE COMPANY = 0 ;

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-10-19 : 11:02:07
There is already a row in that table with Company=1 and duplicates are not allowed.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -