我在 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”