Re: How do you create ##Temp tables if they don't exist, use them if they do?
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Sat, 2 Sep 2006 09:00:52 +0000 (UTC)
M Bourgon (bourgon@xxxxxxxxx) writes:
For me, it's mostly a matter of not having to have _another_ random
table that I'll come back to in 5 years and wonder what's going on. We
have a bunch of those already, and I can't reuse one in case they run
simultaneously. The reason it's a global temp table is that so that if
it's running long, I can take a look. (Yes, I know I could do that if
it were a permanent table.)
We have a bunch (> 20) of such tables in our system. They are also very
easy to identify, as we have a naming convention for them. In our case,
the convention is that the table table ends in -aid. You may pick another
convention, but the key is to have a way to tell from the name what kind
of table this is.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- References:
- Prev by Date: Re: Column order/presentation in virtual table (result set from view or UDF)
- Next by Date: Re: BULK INSERT into table with identity column?
- Previous by thread: Re: How do you create ##Temp tables if they don't exist, use them if they do?
- Next by thread: Restore Messed Up Table Names
- Index(es):
Relevant Pages
|