I have a simple script, which display all constraints of some table:
SELECT *
FROM DB_NAME.INFORMATION_SCHEMA.CONSTRAINT_TABLE_USAGE
WHERE TABLE_SCHEMA = 'dbo' AND TABLE_NAME = 'TestTable'
How I can drop all constraints in TestTable
and use selection of previous query (MS SQL Server 2012)? Or it will be bad way to drop constraints?
I found some solutions, but I don't understand where they get information about constraints.