sql server - Checking for Constraint -
i need write sql script ensure constraint existing.
if constraint exists, dropping constraint. how achieve this?
if object_id('schema.constraintname') not null alter table schema.foo drop constarintname you need schema.constraintname correctly resolve schema. have 2 pk_foo objects if have tables this.foo , that.foo
Comments
Post a Comment