Return to Snippet

Revision: 8936
at October 14, 2008 13:52 by hoffstein


Initial Code
IF EXISTS (
    SELECT 1 FROM INFORMATION_SCHEMA.TABLES 
    WHERE TABLE_NAME = 'MyTable' AND TABLE_SCHEMA = 'dbo'
) 
BEGIN
    DROP TABLE dbo.MyTable
    PRINT 'Dropped dbo.MyTable'
END

Initial URL

                                

Initial Description

                                

Initial Title
TSQL delete table if it already exists

Initial Tags

                                

Initial Language
SQL