title: How can I check if a SQL Server constraint exists?
body: <p>I have the following:</p>
  
  <pre><code>IF OBJECT_ID(N'[dbo].[webpages_Roles_UserProfiles_Target]', 'xxxxx') IS NOT NULL
     DROP CONSTRAINT [dbo].[webpages_Roles_UserProfiles_Target]
  </code></pre>
  
  <p>I want to be able to check if there is a constraint existing before I drop it. I use the code above with a type of 'U' for tables. </p>
  
  <p>How could I modify the code above (change the xxxx) to make it check for the existence of the constraint ?</p>