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 Programming
 Update query Help

Author  Topic 

jgeorge
Starting Member

6 Posts

Posted - 2015-05-07 : 12:48:21
annot insert duplicate key row in object 'dbo.CV3ClassType' with unique index 'ClassTypeIdx'. The duplicate key value is (NSI).



Update CV3ClassType
SET CODE = NSI

(select distinct
ocmi.name,
ct.code,
ctv.value
from
cv3ordercatalogmasteritem ocmi
join CV3CatalogClassTypeValue ctv on ctv.CatalogMasterGUID = ocmi.guid
join CV3ClassType ct on ct.guid = ctv.ClassTypeGUID
where
-- ct.code like 'Antimicrobial Stewardship'
ctv.active = 1
and ct.active = 1
and ocmi.name in ('0.45% NaCl','0.9% NaCl') )


Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2015-05-07 : 18:25:59
[CODE]Update CV3ClassType
SET CODE = NSI

(select distinct
ocmi.name,
ct.code,
ctv.value
from
cv3ordercatalogmasteritem ocmi
join CV3CatalogClassTypeValue ctv on ctv.CatalogMasterGUID = ocmi.guid
join CV3ClassType ct on ct.guid = ctv.ClassTypeGUID
where
-- ct.code like 'Antimicrobial Stewardship'
ctv.active = 1
and ct.active = 1
and ocmi.name in ('0.45% NaCl','0.9% NaCl')
and CODE <> NSI
)



I would rather be the man who bought the Brooklyn Bridge than the one who sold it. -Will Rogers
Go to Top of Page
   

- Advertisement -