SELECT failed because the following SET options have incorrect settings: 'ARITHABORT'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or query notifications and/or xml data type methods.
Can anyone say what problem in the following statements
while(@CountOfFile>=@Inc)
begin
SELECT @FileName = Attachments.value('(/Files/File[@Id=sql:variable("@Inc")]/Name/text())[1]','nvarchar(50)') FROM MOD_Quiz where Id = @Id
select @FilePath = Attachments.value('(/Files/File[@Id=sql:variable("@Inc")]/FilePath/text())[1]','nvarchar(50)') FROM MOD_Quiz where Id = @Id
set @Actual_Path = @FilePath + '/' + @Id + '/' + @FileName
set @Inc=@Inc+1
update MOD_Quiz set Attachments.modify('replace value of (/Files/File[@Id=sql:variable("@Inc")]/FilePa开发者_Go百科th/text())[1] with sql:variable("@Actual_Path") ') where Id =@Id
end
As the error says: there's nothing wrong with your SELECT
statements, but there's something wrong with your general SET ARITHABORT setting.
As this article on TechNet explains, for an indexed view or XML data type methods, you need to have SET ARITHABORT ON
. So put that statement before yours and you should be fine.
精彩评论