Click to See Complete Forum and Search --> : Temp Table


shuvo
April 21st, 2007, 05:05 AM
I am doing a website which many users might hit at the same time.I am using a stored procedure which creates temporary tables,fills it with data and after using it, deletes it.As many users will operate in the website,many instance of the stored procedure might be running at the same time.What about the temp tables?If in one stored procedure #table1 is created and while it is being used, another instance of the storedprocedure calls drop #table1.Is there a chance of this kind of conflict happening?Or the # marked temp tables are managed differently by the database?

hspc
April 21st, 2007, 05:19 AM
The scope of temp tables with one # is the connection. So they are not global and there is no chance that a conflict happens.
In other words, each user (connection) will have its own version of #table1.

And just for your information, tables created using two # (as ##table1) are global and can be accessed using multiple connections.

This information is based on MS SQL Server.

shuvo
April 21st, 2007, 06:40 AM
thank you very much for the information hspc. :wave: