我正在做:
DELETE FROM mytable WHERE id = '6B4AE2C6-7C26-4BB0-AEC2-9590A7A167F3' AND idFK='F3696D77-AC4A-4235-B6CB-C887D62FF860' AND data=3
( Id
is aPK uniqueidentifier
和idFK
is a FK uniquedientifier
, not null
both. Data
is int
not null
)
然后我做:
INSERT INTO mytable (id, idFK, data)
VALUES ('6B4AE2C6-7C26-4BB0-AEC2-9590A7A167F3','F3696D77-AC4A-4235-B6CB-887D62FF860',6)
这就是我得到错误的地方:
无法在具有唯一索引“ixmytable”的对象“dbo.mytable”中插入重复的键行。
这是选择:
SELECT * FROM mytable WHERE id = '6B4AE2C6-7C26-4BB0-AEC2-9590A7A167F3' AND idFK='F3696D77-AC4A-4235-B6CB-C887D62FF860' AND data=3
它显示了什么:
------------------+ id +-- ---+ idFK +------ -+ data
6B4AE2C6-7C26-4BB0-AEC2-9590A7A167F3 F3696D77-AC4A-4235-B6CB-C887D62FF860 3
为什么我会收到此错误?