>I have some code that are removing a primary key from all my tables. However, if this primary key does not exist, this will stop the script once reached. I need to verify if the primary key exists first before attempting to remove it. I have this presently:
>
>
>ALTER TABLE [MyTable] DROP CONSTRAINT Numero
>
IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS
WHERE CONSTRAINT_TYPE = 'PRIMARY KEY'
AND TABLE_NAME = 'MyTable')
--sb--