-
Temporary Table
Hi,
I use VB2005 as front-end, SQL Server as backend. Can we do create temporary table as "Create table #username ....................."?
when the user log off the program, then the temp table will be removed automatically, similar create temporary table in Query Analyzer, when close Query Analyzer, the temp table is removed.
-
Re: Temporary Table
To drop a table you have to execute a DROP TABLE statement. Presumably the authors of Query Analyzer have implemented the functionality to execute that statement for you. In your project you're the author, so it's up to you to implement that functionality.
-
Re: Temporary Table
The tables I create that I don't need get a "Drop tablename" after I'm done with them.
-
Re: Temporary Table
I don't know why you're asking. You could have tried this yourself.
Anyway, temporary tables are automatically dropped when they go out of scope (when you close the connection), although you can drop them yourself before that point if you want.
To create a temporary table you need the CREATE TABLE privilege.