Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql server drop temp table if exists

IF OBJECT_ID('tempdb..#Results') IS NOT NULL DROP TABLE #Results
GO
Comment

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 :: 1) PostgreSQL DESCRIBE TABLE using psql 
Sql :: mysql union 
Sql :: sql convert varchar to date 
Sql :: how to check table lock 
Sql :: SQL Server lock table example 
Sql :: mysql change default collation 
Sql :: mysql get latest duplicate rows 
Sql :: how to select one row in mysql 
Sql :: postgresql append array 
Sql :: postgresql concatenate multiple rows into one row 
Sql :: get foreign table names mysql 
Sql :: sort by sql 
Sql :: how to delete the rows with null values in mysql 
Sql :: mssql check if date is greater than today 
Sql :: how to connect sql database in python 
Sql :: mysql version 
Sql :: version and edition of SQL Server Database Engine 
Sql :: alter table add column in sql server 
Sql :: sql server add time to date 
Sql :: for json path sql server 
Sql :: enable foreign key checks postgres 
Sql :: sql cheatsheet 
Sql :: mysql remove records 
Sql :: increment integer in table sql 
Sql :: postgresql random phone number 
Sql :: mysql function variable 
Sql :: postgres week number 
Sql :: sqlalchemy empty table 
Sql :: limit offset sql server 
Sql :: how to find unique key in sql 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =