Return to Snippet

Revision: 19566
at October 26, 2009 05:31 by marcocs


Initial Code
SELECT  'ALTER TABLE ' + TABLE_SCHEMA + '.[' + TABLE_NAME
        + '] DROP CONSTRAINT [' + CONSTRAINT_NAME + ']'
FROM    information_schema.table_constraints
WHERE   CONSTRAINT_TYPE = 'FOREIGN KEY'

Initial URL

                                

Initial Description
Delete All Foreign Keys in a database;
(make sure you USE keyword)

Initial Title
Delete All Foreign Keys

Initial Tags
sql

Initial Language
SQL