-1
不兼容當我執行此代碼時,出現此錯誤。 操作數類型衝突:uniqueidentifier與int不兼容。請刪除此錯誤的解決方案是什麼?由於SQL-Server - 操作數類型衝突:uniqueidentifier與int
CREATE FUNCTION [a01].[udf_isUserActive]
(@AccountID INTEGER)
RETURNS BIT
AS
BEGIN
IF (EXISTS (SELECT accountID
FROM [a01].[tbl_userAccounts]
WHERE accountID = @AccountID
AND isActive = 1))
RETURN 1;
RETURN 0;
END;
GO
「accountID」的數據類型可能是'uniqueidentifier'不是整數。 –
CREATE FUNCTION [A01]。[udf_isUserActive] (@AccountID UNIQUEIDENTIFIER) RETURNS BIT AS BEGIN IF(EXISTS(SELECT帳戶ID FROM [A01]。[tbl_userAccounts] WHERE帳戶ID = @AccountID AND isActive = 1 )) RETURN 1; RETURN 0; END; GO – BakingCake
這是好版本^? – BakingCake