I am trying to update my table "tender".
It has these columns:
- requisition no(rq_no)
- requisition year(rq_year)
- tender number(te_no)
- te_date
- te-due_date
- tender status(te_status)
- te_year
I tried the below code:
update tender
set te_status='D'
where rq_no like 'Q052401C' AND te_year like '2012' and te_no like 'n0066'
if I place any other character in place of 'D'
in te_status
, update is successful except for 'D'
e.g.:
set te_status='S'
When I run
SELECT * FROM TENDER
WHERE
rq_no LIKE 'Q052401C' AND te_year LIKE '2012' AND te_no LIKE 'n0066'
, it returns a single row.
Ιt shows me the following error:
Msg 2627, Level 14, State 1, Line 1 Violation of PRIMARY KEY constraint 'PK_tender'. Cannot insert duplicate key in object 'dbo.tender'. The duplicate value is (N0066, Q052401C, D, 2012) The statement has been terminated.
What does all these mean?