Search This Blog

Tuesday, April 2, 2013

DROP TABLE SQL Server

SQL Server > DDL > Drop > Table

Removes table definitions and data, indexes, triggers, constraints, and permissions for that table.

Example:

1. Simple drop
    DROP TABLE table_name

2. Drop temporary table and tests for its existence before

  if object_id('tempdb.dbo.##MyGlobalTemp1') Is Not Null
    DROP TABLE ##MyGlobalTemp1