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 |
|
qutesanju
Posting Yak Master
193 Posts |
Posted - 2010-08-16 : 05:15:58
|
| hi expertsI'm firing an update statement in a table UPDATE [dbo].[LOC_XREF]set [KC_LOC_XREF_MES_MACHI_CHR] = '2028BILGNM09' WHERE [ENTY_KEY] ='102166793'however i'm getting an error as Cannot insert duplicate key row in object 'dbo.LOC_XREF' with unique index 'ix_LOC_XREF_1'.how to resolve this issue? |
|
|
vaibhavktiwari83
Aged Yak Warrior
843 Posts |
Posted - 2010-08-16 : 05:22:08
|
| This update statement is about to change data that combination is already exists.and that is not possible because with that key column unique index is created.Vaibhav TTo walk FAST walk ALONE To walk FAR walk TOGETHER |
 |
|
|
qutesanju
Posting Yak Master
193 Posts |
Posted - 2010-08-16 : 07:34:25
|
| i deleted that entry completely and tried inserting fresh one but it saysCannot insert duplicate key row in object 'dbo.KC_LOC_XREF' with unique index 'ix_kc_loc_xef_1'. |
 |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2010-08-16 : 07:43:45
|
| What's the definition of the unique index ix_kc_loc_xef_1?How many rows will that update affect?--Gail ShawSQL Server MVP |
 |
|
|
qutesanju
Posting Yak Master
193 Posts |
Posted - 2010-08-16 : 08:46:22
|
| index name ix_kc_loc_xef_1 is nonclustered, unique located on PRIMARYand index keys are LOC_XREF_MES_DATAB_CHR, LOC_XREF_MES_MACHI_AREA_CHR, LOC_XREF_MES_MACHI_CHR, LOC_XREF_MES_SYSTE_CHR |
 |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2010-08-16 : 09:29:41
|
| How many rows will that update affect?--Gail ShawSQL Server MVP |
 |
|
|
qutesanju
Posting Yak Master
193 Posts |
Posted - 2010-08-16 : 11:34:31
|
| for search criteria this shuld update only one row |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|
|