title: SQL Server Stored Procedure Syntax
body: <p>I am not really a SQL man, so I'm struggling. What is wrong with <code>"program"</code> below that is preventing me from creating this stored procedure? Any help or clean up suggestions would be great.</p>
  
  <pre><code>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
  </code></pre>