Quantcast
Channel: beyondrelational.com
Viewing all articles
Browse latest Browse all 25

DROP command with multiple tables

$
0
0
There is a question in the forum where questioner asked "I created lot of temporary tables like #temp1, #temp2, #temp3, etc. Is there a way to drop them all in a single statement?" Well. Not many people know that you can drop multiple tables using a single DROP command. 

Consider the following tables
create table #temp1 (col1 int)
create table #temp2 (col2 int)
create table #temp3 (col3 int)
You can drop all those tables using the following
drop table #temp1,#temp2,#temp3
How many of you know this?

Viewing all articles
Browse latest Browse all 25

Trending Articles