Drop All constraints in a Table
Am trying to write script for removing Constraints. I have the below function to select the Constarints in my DataBase SELECT name FROM sys.foreign_keys And I have written alter scripts using the above scripts SELECT 'ALTER TABLE ' + OBJECT_NAME(parent_object_id) + ' DROP CONSTRAINT ' + name FROM sys.foreign_keys Using the above query how can I execute these constraints ? I can use DROP DATABASE DBName . But am just trying to drop tables by dropping Constraints. is it possible without going for SP ? Or any easy ways I can proceed? Well you can always copy the output from the bottom pane, paste