SQL server query to drop all foreign keys on a table
Budget: $30 – $250 USD
I need ONE(1) query that can automatically drop all foreign keys and then drop the table on SQL Server. It has to be one query. Something similar to the query below
EXEC sp_MSforeachtable
@command1
@command2
'ALTER TABLE? NOCHECK CONSTRAINT ALL'
'DROP TABLE ?
@whereand
=
'AND SCHEMA NAME (schema_id)
" 'B1'1
EXEC sp_MSforeachtable
@command1
@command2
'ALTER TABLE? NOCHECK CONSTRAINT ALL'
'DROP TABLE ?
@whereand
=
'AND SCHEMA NAME (schema_id)
" 'B1'1