我的代碼插入的數據是作爲XML從C#代碼中傳遞的,後面的代碼在本地正常工作到SQL Server 2008中,但在SQL Server 2005的遠程實例上拋出以下例外。請幫忙。由於INSERT失敗而陷入錯誤,因爲以下SET選項的設置不正確
CREATE PROCEDURE SqAnswersInsert @AnswerID INT OUTPUT,
@ClientID INT = NULL,
@VGBID INT = NULL,
@CreatedOn DATETIME = NULL,
@XmlOptions XML = NULL AS BEGINSET ARITHABORT ON INSERT SqAnswers (ClientID, VGBID, [CreatedOn]) VALUES (@ClientID, @VGBID, @CreatedOn) SET @AnswerID=Scope_identity() INSERT INTO SqAnswerOptions (AnswerID, QuestionOptionID) SELECT @AnswerID,A.B.value('QuestionOptionID[1]', 'INT') AS QuestionOptionID --A.B.value('QuestionOptions/QuestionOptionID', 'INT') as QuestionOptionID FROM @XmlOptions.nodes('/QuestionOptions/Option') A(B) SET ARITHABORT OFF END
INSERT失敗,因爲以下SET選項有不正確的設置:'ARITHABORT'。驗證SET選項是否適用於計算列和/或過濾索引和/或查詢通知和/或XML數據類型方法和/或空間索引操作的索引視圖和/或索引。
您可以發佈您的查詢? –
@NagarajS請檢查現在的查詢 –