user240141
user240141

Reputation:

Dropping Sql Temp tables from Vb.Net

I have a vb.net app , and I am creating and dropping temp tables. I just want to know whether the temp tables created programatically from some client app will get dropped automatically with dispose of application or we should have to drop it explicitly by code.

I need to be sure that all tables will get dropped when I close my app or that block has been executed successfully.

Right now I am dropping using drop table .... I need code to check existing temp table in sql server and drop them all at a time on form close.

I hope my lines are clear.

Environment is VB.Net + Sql Server 2008

Upvotes: 0

Views: 1623

Answers (1)

no_one
no_one

Reputation: 1850

Local Temp tables are disposed of when the session closes.

Global temp tables (with ## prefix) are dropped off when the last connection using it closes.

Upvotes: 1

Related Questions