當試圖從表中檢索字符串時,在此簡單SQL語句中出現此錯誤。將varchar值'my返回值'轉換爲數據類型int時轉換失敗
Msg 245,Level 16,State 1,Procedure prViewRequirements,Line 18 轉換varchar值'Cardiac Assessment Questionnaire by Dr.'時轉換失敗到數據類型int。
/****** Object: StoredProcedure [dbo].[prViewRequirements] Script Date: 04/24/2013 15:44:49 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[prViewRequirements]
@WFRouteID int
AS
DECLARE
@DocumentDescription VARCHAR(100)
SELECT @DocumentDescription = DocumentDescription
FROM tbFollowOnTracking
WHERE WFRouteID = @WFRouteID
AND IsActive = 1
IF (@@ERROR <> 0)
GOTO ERRSP
RETURN @DocumentDescription
ERRSP:
RETURN -1
有沒有人知道爲什麼?
哪條線是線18? – Patashu 2013-04-29 06:06:56
第18行是 - WHERE WFRouteID = @WFRouteID – 2013-04-29 06:11:25