Tuesday, March 27, 2012

create a temporary table

How to create a temporary table where the name of the table is the user's
ID.
#@.IDUsuarioYou can't unless you use dynamic sql but then the table only lasts as long
as the dynamic sql scope. If every table will be unique to that user why not
create a real table instead?
Andrew J. Kelly SQL MVP
"Frank Dulk" <fdulk@.bol.com.br> wrote in message
news:OqFFzMxFGHA.2040@.TK2MSFTNGP14.phx.gbl...
> How to create a temporary table where the name of the table is the user's
> ID.
> #@.IDUsuario
>|||Why would you want to do that? Temp tables internal names are unique, so you
don't have to worry
about duplicates, and one session cannot see another sessions temptable anyh
ow.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Frank Dulk" <fdulk@.bol.com.br> wrote in message news:OqFFzMxFGHA.2040@.TK2MSFTNGP14.phx.gbl
..
> How to create a temporary table where the name of the table is the user's
> ID.
> #@.IDUsuario
>

No comments:

Post a Comment