0 Replies - 1499 Views - Last Post: 04 November 2007 - 08:54 PM

#1 girasquid   User is offline

  • Barbarbar
  • member icon

Reputation: 108
  • View blog
  • Posts: 1,825
  • Joined: 03-October 06

MSSQL: drop table if exists

Posted 04 November 2007 - 08:54 PM

Description: Use this query to drop the table 'users' from an MS SQL database.MSSQL doesn't support the "DROP TABLE IF EXISTS [table]" syntax. Here's how to do the same thing under MSSQL.
IF EXISTS(SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'users') DROP TABLE users;

Is This A Good Question/Topic? 0
  • +

Page 1 of 1