temp tables and locking issues
From: Zidgan (rcloninger_at_triad.rr.com)
Date: 06/16/04
- Previous message: Scott D: "Transact Max Statement"
- Next in thread: hkvats_1999_at_yahoo.com: "Re: temp tables and locking issues"
- Reply: hkvats_1999_at_yahoo.com: "Re: temp tables and locking issues"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 16 Jun 2004 23:01:19 GMT
I am a developer and am by no means an expert in SQL. I have used temp
tables frequently, especially in nested stored procedures against our
SQL Server 2000 database. However, recently I have found many
articles on the web warning about performance issues with temp tables.
One concern is locking. Each article seems to explain it differently.
One article simply said not to use them because the tempdb is locked
while the "select into" was running. Another article seemed to imply
the tempdb is locked only while the database is trying to define the
temporary table on a SELECT INTO command. Still another said it was
locked during a transaction. Today I tried a number of tests trying
to ascertain what was locked and when. So far I have not been able to
validate any of these things.
I would appreciate a clarification on this, and possibly some sample
code, perhaps against the Northwinds database, that could show the
effect of the locking. If it is a problem, I would like to
demonstrate it to the other developers. The questions are:
Is the tempdb only locked during the time the table is being created?
Is it locked during the entire time of the Select Into process?
Is the tempdb locked during any transactions using it?
I appreciate advice from the experts. Thanks
- Previous message: Scott D: "Transact Max Statement"
- Next in thread: hkvats_1999_at_yahoo.com: "Re: temp tables and locking issues"
- Reply: hkvats_1999_at_yahoo.com: "Re: temp tables and locking issues"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|