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 |
bobred
Starting Member
14 Posts |
Posted - 2015-02-13 : 04:08:19
|
HiI am trying to update a field and I'm getting the error 'Violation of UNIQUE KEY constraint'. I have a temp table where the data to be updated is stored then I am using the following to update the other tableUPDATE [CostCentre] SET [CostCentreCode] = V.[CostCentreCode] FROM [CostCentre] Y INNER JOIN [RCH Cost Centres] V ON Y.[CostCentreId]=V.[CostCentreId] I have checked and there are no constraints showing on this field or foreign keys.Any ideas? |
|
stepson
Aged Yak Warrior
545 Posts |
Posted - 2015-02-13 : 04:31:34
|
Check for trigger on table CostCentresabinWeb MCP |
|
|
bobred
Starting Member
14 Posts |
Posted - 2015-02-13 : 04:51:59
|
HiI found the problem, there was a duplicate in my source data, doh!James |
|
|
|
|
|