|
Posted by Erland Sommarskog on 09/07/06 21:03
(cphite@gmail.com) writes:
> There are a lot of reasons someone might want to create a table on the
> fly. They might want to store a snapshot of data at a given time that
> is easily accessable. It may not fit your ideal of how SQL "should" be
> used, but it's actually quite common in the real world - and it need
> not invoke images of falling pachyderms.
Yes, temp tables are a fair game, but dynamically named tables isn't.
If nothing else, because it's completely painful to work with them.
Reading the original post again, I think the real solution that Pukivruki
needs is a permanent table keyed by a process id. Often @@spid can be
used as key, but in this case @TICKET may be a better choice.
See http://www.sommarskog.se/share_data.html#prockeyed for some more
discussion on the idea.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
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
Navigation:
[Reply to this message]
|