以下是我到目前为止的存储过程,执行时我不断收到此错误:消息 137,级别 16,状态 1,过程 db_recession_band_dates_save,第 18 行必须声明标量变量“@dates”。
ALTER PROCEDURE [dbo].[Dates_Save]
@Loc VARCHAR(75),
@dates StartEndDateType READONLY
AS
BEGIN
DECLARE @id int
SELECT @id = MYINTFIELD FROM date_locations
IF @id IS NULL
BEGIN
INSERT INTO db_recession_bands VALUES (@loc)
SET @id = @@IDENTITY
END
INSERT INTO db_recession_band_dates VALUES (@id,@dates)
END