SQL Server でストアド プロシージャを作成しましたが、このエラーが発生しましたが、その意味がわかりません。
手順は次のとおりです。
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[Grant_Append]
-- Add the parameters for the stored procedure here
(@GrantNumber AS VARCHAR(50),
@GrantName AS VARCHAR(100),
@ProjectCode AS VARCHAR(50),
@LOCID AS INT,
@Comments AS VARCHAR(100),
@Provider AS VARCHAR(100),
@ISAT AS NCHAR(10),
@TypeID AS INT,
@Slots AS FLOAT,
@Patients AS FLOAT,
@FundingMethod AS VARCHAR(50),
@L1600 AS MONEY,
@L1602 AS MONEY,
@L1603 AS MONEY,
@L1608 AS MONEY,
@L1612 AS MONEY,
@ADAAFunding AS MONEY,
@ProgramBudget AS MONEY,
@Jurisdiction AS INT,
@VersionType AS VARCHAR(20),
@VersionNum AS INT)
AS BEGIN
INSERT INTO dbo.Grant
(GrantNumber,
GrantName,
ProjectCode,
LOCID,
Comments,
Provider,
ISAT,
TypeID,
Slots,
Patients,
FundingMethod,
[1600],
[1602],
[1603],
[1608],
[1612],
ADAAFunding,
ProgramBudget,
Jurisdiction,
VersionType,
VersionNum,
SubmitDate)
-- Insert statements for procedure here
SELECT @GrantNumber,
@GrantName,
@ProjectCode,
@LOCID,
@Comments,
@Provider,
@ISAT,
@TypeID,
@Slots,
@Patients,
@FundingMethod,
@1600,
@1602,
@1603,
@1608,
@1612,
@ADAAFunding,
@ProgramBudget,
@Jurisdiction,
@VersionType,
@VersionNum,
getdate()
END
エラーは次のとおりです。
メッセージ 156、レベル 15、状態 1、プロシージャ Grant_Append、行 30
キーワード「Grant」付近の構文が正しくありません。
メッセージ 137、レベル 15、状態 2、プロシージャ Grant_Append、行 65
変数 '@1600' を宣言する必要があります