|
Posted by Gert-Jan Strik on 09/26/06 21:37
Shelley,
Aparently, there is a unique constraint with _CUSTOMER_.client in its
definition. There probably is a unique constraint on the client column.
You are updating this key column. If the results table contains
duplicates in the adid column, then this would create duplicates in the
_CUSTOMER_.client column which are disallowed by the constraint.
By the way: I feel sorry for the person that has to maintain this
database because your schema and table names are very hard to read with
all the confusing underscores. But I guess that is just my personal
opinion.
Gert-Jan
sbowman wrote:
>
> I ran the following update query in Sql Server 8.0:
>
> update _SMDBA_._CUSTOMER_
> set _SMDBA_._CUSTOMER_.client = dbo.results.adid
> from _SMDBA_._CUSTOMER_, dbo.results
> where _SMDBA_._CUSTOMER_.client = dbo.results.clientid;
>
> I got the following error:
> Server: Msg 2627, Level 14, State 2, Line 1
> Violation of UNIQUE KEY constraint 'UQ_CUSTOMER_CLIENT'. Cannot insert
> duplicate key in object '_CUSTOMER_'.
> The statement has been terminated.
>
> Shouldn't the update query update the records that match in the
> dbo.results table? I'm not appending data, i'm updating...I don't
> understand why I'm getting this error! Any help is much appreciated!!
>
> Shelley
Navigation:
[Reply to this message]
|