HOW TO check if a temporary table exists before DROPping

To check if a temporary table already exists before DROPping, use

If Object_Id('tempdb..#big') is Not Null

Drop table #big

BTW, Are SQL Server Temp Tables Really Necessary?


Comments

Popular posts from this blog

Maven Crash Course - Learn Power Query, Power Pivot & DAX in 15 Minutes

"Data Prep & Exploratory Data Analysis" course by Maven Analytics

Oracle Cloud Infrastructure 2024 Generative AI Professional Course & Certification Exam (1Z0-1127-24)