SQL DROP TABLE foreign key constraint
Posted
by Polly Hollanger
on Stack Overflow
See other posts from Stack Overflow
or by Polly Hollanger
Published on 2009-11-21T17:15:07Z
Indexed on
2010/03/22
6:51 UTC
Read the original article
Hit count: 283
If I want to delete all the tables in my database like this, will it take care of the foreign key constraint? If not, how do I take care of that first?
GO
IF OBJECT_ID('dbo.[Course]','U') IS NOT NULL
DROP TABLE dbo.[Course]
GO
IF OBJECT_ID('dbo.[Student]','U') IS NOT NULL
DROP TABLE dbo.[Student]
© Stack Overflow or respective owner