1
我要檢查是否有一些用戶定義的表類型的參數具有值或者是NULL值,但我收到以下錯誤檢查是否UTD參數在存儲過程
Msg 137, Level 16, State 1, Procedure SearchByWord, Line 63 [Batch Start Line 7]
Must declare the scalar variable "@Words".
的存儲過程如下(僅相關部分)
CREATE PROCEDURE [dbo].[SearchByWord]
(
@Words Word_List READONLY
)
AS
BEGIN
SET NOCOUNT ON;
-- some DECLARE and SET
IF @Words IS NOT NULL
BEGIN
-- stuff
END
-- more stuff
END
用戶定義的表型是
CREATE TYPE [dbo].[Word_List] AS TABLE(
[element] [varchar](512) NULL
)
我覺得自己像一個垃圾堆,我完全忘了EXISTS clausule ...謝謝 – NioZero