我不是一个真正的SQL人,所以我很挣扎。 "program"
下面有什么问题阻止我创建此存储过程?任何帮助或清理建议都会很棒。SQL Server存储过程语法
ALTER PROCEDURE [dbo].[CreateHaystackExportJob_Program]
-- Add the parameters for the stored procedure here
@ID AS VARCHAR
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
DECLARE @JobCount AS INT
SELECT
@JobCount = COUNT (*)
FROM
dbo.HaystackExportJobs
WHERE
ID = @ID AND ExportType = "program"
IF @JobCount = 0
INSERT INTO dbo.HaystackExportJobs (ID,ExportType) VALUES (@ID,"program")
END
如果你发布错误信息,你会得到更好的反馈 – 2013-02-11 00:24:11
你是对的,抱歉。 – MFB 2013-02-11 00:45:48