我创建了一个唯一索引(如果 IsDelete != 1,案例描述应该是唯一的)
CREATE UNIQUE NONCLUSTERED INDEX [UniqueCaseDescription]
ON [tblCases] ([fldCaseDescription] ASC)
WHERE [IsDeleted] = CAST(0 AS varbinary(1))
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
然后,当我运行以下过程时,它会抛出“更新失败,因为以下 SET 选项的设置不正确:'ARITHABORT'。验证 SET 选项对于过滤索引的使用是否正确。
ALTER PROC [usp_DeleteCase] (@fldCaseID UNIQUEIDENTIFIER)
AS
BEGIN
UPDATE tblCases
SET IsDeleted = 1
WHERE fldCaseID = @fldCaseID
RETURN 1
END
我尝试在 UPDATE 语句之前添加 SET ARITHABORT ON ,但这没有做任何事情。
任何帮助是极大的赞赏!