title: SQL Server Agent Job - Exists then Drop?
body: <p>How can I drop sql server agent jobs, if (and only if) it exists?</p>
  <p>This is a well functioning script for <em>stored procedures</em>. How can I do the same to sql server agent jobs?</p>
  <pre><code>if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[storedproc]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
      drop procedure [dbo].[storedproc]
  GO
  CREATE PROCEDURE [dbo].[storedproc] ...
  </code></pre>