我有這樣的代碼:不能創建存儲過程表輸出參數
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[GetProfitDeals]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[GetProfitDealsVar2]
GO
IF EXISTS(SELECT 1 FROM sys.types WHERE name = 'TableOrderType' AND is_table_type = 1 AND SCHEMA_ID('dbo') = schema_id)
DROP TYPE [dbo].[TableOrderType];
CREATE TYPE TableOrderType AS TABLE(
Order_ID int NOT NULL,
Order_AccNumber int NOT NULL,
Order_OpenDate datetime NULL,
Order_CloseDate datetime NULL,
Order_Profit float NULL
);
GO
CREATE PROCEDURE [dbo].[GetProfitDeals](@OpenDate datetime = NULL, @CloseDate datetime = NULL, @MinProfit float = NULL, @out TableOrderType OUTPUT READONLY)
AS
INSERT INTO @out
SELECT * FROM [Orders]
WHEN [Orders].[OpenDate] >= @OpenDate
GO
但我得到的錯誤「Incorrrect語法關於建設‘READONLY’」。我如何解決這個問題,因爲我真的需要一個OUTPUT表參數。