drop temp table if exists

sql Drop a temporary table if it exists Stack Overflow. Web  3 Answers. IF OBJECT_ID ('tempdb..##CLIENTS_KEYWORD', 'U') IS NOT NULL /*Then it exists*/ DROP TABLE ##CLIENTS_KEYWORD CREATE TABLE ##CLIENTS_KEYWORD ( client_id INT ) You could also consider truncating the table instead rather than dropping and recreating.

sql Drop a temporary table if it exists Stack Overflow
sql Drop a temporary table if it exists Stack Overflow from www.tech-recipes.com

Web  IF OBJECT_ID ('tempdb..#Results') IS NOT NULL Truncate TABLE #Results else CREATE TABLE #Results ( Company CHAR (3), StepId TINYINT, FieldId TINYINT, ) If you are using Sql Server 2016 or Azure Sql Database then use the below syntax to drop the temp table and recreate it. More info here MSDN.

Post a Comment for "drop temp table if exists"