I have the following:
IF OBJECT_ID(N'[dbo].[webpages_Roles_UserProfiles_Target]', 'xxxxx') IS NOT NULL
DROP CONSTRAINT [dbo].[webpages_Roles_UserProfiles_Target]
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.
How could I modify the code above (change the xxxx) to make it check for the existence of the constraint ?