我不是一个真正的 SQL 人,所以我很挣扎。下面有什么问题"program"
阻止我创建这个存储过程?任何帮助或清理建议都会很棒。
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