Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql drop table if exists

DROP TABLE IF EXISTS dbo.Customers
Comment

sql server drop table if exists

IF OBJECT_ID('dbo.Scores', 'U') IS NOT NULL DROP TABLE dbo.Scores; 
Comment

drop table if exists

DROP TABLE IF EXISTS dbo.Scores
Comment

SQL DROP TABLE IF EXISTS

DROP TABLE IF EXISTS my_table;
Comment

t-sql drop function if exists

IF EXISTS (
    SELECT * FROM sysobjects WHERE id = object_id(N'function_name') 
    AND xtype IN (N'FN', N'IF', N'TF')
)
    DROP FUNCTION function_name
GO
Comment

sql server drop table if exists

-- Classic table
IF OBJECT_ID('my_schema.my_table', 'U') IS NOT NULL DROP TABLE my_schema.my_table; 
-- Temporary table
IF OBJECT_ID('tempdb.my_schema.#my_table') IS NOT NULL DROP TABLE #my_table; 
Comment

sql drop table if exists

IF OBJECT_ID('dbo.Scores', 'U') IS NOT NULL 
  DROP TABLE dbo.Scores; 
Comment

if table exists drop

IF EXISTS(SELECT *
          FROM   dbo.Scores)
  DROP TABLE dbo.Scores
Comment

PREVIOUS NEXT
Code Example
Sql :: mysql reset auto increment id 
Sql :: Oracle Column Names of a table 
Sql :: mysql update inner 
Sql :: Oracle NLS_CHARACTERSET 
Sql :: sql server 2008 first and last day of month 
Sql :: get first 3 letters in sql 
Sql :: string split in sql server 
Sql :: difference between where and having clause 
Sql :: create column sql 
Sql :: oracle list of long running queries 
Sql :: how to check current user in mysql 
Sql :: mariadb.service: Main process exited, code=exited, status=1/FAILURE 
Sql :: find logged in users mysql 
Sql :: mysql public key retrieval is not allowed 
Sql :: oracle create datafile 
Sql :: mysql how to subtract dates 
Sql :: org.h2.jdbc.jdbcsqlsyntaxerrorexception table not found 
Sql :: sql show tables 
Sql :: oracle limit rows 
Sql :: mysql add fields 
Sql :: delete role postgres 
Sql :: how to drop a database in sql server when it is in use 
Sql :: sql timestamp to date 
Sql :: datepart postgres 
Sql :: postgresql today - 1 year 
Sql :: docker run postgres locally 
Sql :: get date ISO in psql 
Sql :: temp table sql 
Sql :: sql remove last 2 digit 
Sql :: execute stored procedure 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =