Return to Snippet

Revision: 62344
at February 17, 2013 23:58 by fixpq


Initial Code
SELECT 
    'ALTER TABLE ' + OBJECT_NAME(parent_object_id) + 
    ' DROP CONSTRAINT ' + name
FROM sys.foreign_keys

EXEC sp_MSforeachtable @command1 = "DROP TABLE ?"

Initial URL

                                

Initial Description
It removes relations before deleting tables.

Initial Title
Delete all tables from SQL

Initial Tags
sql

Initial Language
SQL