Search
 
SCRIPT & CODE EXAMPLE
 

SQL

if temp table exists drop

if object_id(N'tempdb..#MaxTransaction') is not null drop table #MaxTransaction
Comment

Check if a temporary table exists and delete if it exists

DROP TABLE IF EXISTS #lu_sensor_name_19 

CREATE TABLE #lu_sensor_name_19...
Comment

if temp table exists drop

IF OBJECT_ID(N'tempdb..#RequestingBrokers') IS NOT NULL
BEGIN
DROP TABLE #RequestingBrokers
END
GO
Comment

delete temp table if exists

IF OBJECT_ID('tempdb.dbo.#SeatStatus', 'U') IS NOT NULL  
  DROP TABLE #SeatStatus;  

-- 'U' is object type : U = Table (user-defined) 
Comment

Check if a temporary table exists and delete if it exists

IF OBJECT_ID('tempdb..#lu_sensor_name_19') IS NOT NULL 
BEGIN 
    DROP TABLE #lu_sensor_name_19 
END

CREATE TABLE #lu_sensor_name_19...
Comment

drop temp table if exists

IF OBJECT_ID('tempdb..#abc') IS NOT NULL DROP TABLE #abc
GO
select * into #abc from District  where DistrictId=1
select * from #abc
Comment

PREVIOUS NEXT
Code Example
Sql :: check if sql temp table exists 
Sql :: how to get the number of columns in a table in sql 
Sql :: mysql version query 
Sql :: mysql inner join 3 tables 
Sql :: oracle show index columns 
Sql :: sql server query all database objects 
Sql :: how to see the query of a view in mysql 
Sql :: sql get last id 
Sql :: update value postgresql 
Sql :: oracle trigger after connect 
Sql :: mysql get year from date 
Sql :: oracle sql date get month 
Sql :: CONCAT_WS() concat function in mysql 
Sql :: csv to sqlite python 
Sql :: mysql select tables with name like 
Sql :: SQL Server rename foreign key constraint 
Sql :: mysql row_number() example 
Sql :: drop df constraint sql server 
Sql :: DROP TABLes regardless of constraints 
Sql :: add column in sql server 
Sql :: pad zero sql server 
Sql :: sql server output parameter 
Sql :: mysql regexp_replace remove html tag 
Sql :: sequelize migration default value 
Sql :: mysql terminal run sql file 
Sql :: mariadb mysql root access denied 
Sql :: postgresql connection string c# 
Sql :: sql sum by column 
Sql :: oracle number to percentage 
Sql :: how to create a table in sql 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =