title: SQL: if OBJECT_ID is not null alter table drop constraint VS if exists alter table drop constraint
body: <p>I'm trying to figure out if these two methods used to check the existence of and then drop a constraint are exactly the same or if each gives some sort of difference in result. Code below: </p>
  
  <p>Method 1: </p>
  
  <pre><code>if OBJECT_ID('fk_Copy_Item', 'F') is not null
      alter table Rentals.Copy
      drop constraint fk_Copy_Item;
  go
  </code></pre>
  
  <p>Method 2: </p>
  
  <pre><code>if exists 
  (
      select * from INFORMATION_SCHEMA.TABLE_CONSTRAINTS
      where CONSTRAINT_SCHEMA = 'Rentals'
      and CONSTRAINT_NAME = 'fk_Copy_Item'
      and CONSTRAINT_TYPE = 'foreign key'
  )
  alter table Rentals.Copy
      drop constraint fk_Copy_Item;
  go
  </code></pre>
  
  <p>Thank you! </p>