Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS SQL temporary table not working

Status
Not open for further replies.

numbered

Technical User
Jun 10, 2002
54
0
0
CA
I'm trying to work with temporary tables using MS sql and coldfusion. It's not working the way it should.

<cfquery name="tempTableCreate" datasource="#application.dataSource#">
CREATE TABLE ##table(
id int IDENTITY(1,1) PRIMARY KEY,
value1 smalldatetime NULL,
value2 varchar(5) NULL)
</cfquery>

The problem is that the same temp table exists for all sessions. I need it to be unique for each session. It's only suppose to be active for as long as the connection is live. In coldfusion you don't close a connection. How do I use temp tables with coldfusion?

Thank you,
Seven
 
Seven,

Session-specific temporary tables are prefaced with one pound sign:

#Mytemporarytable

You may still have problems because of connection pooling. Try to name the table something unique to the session. Incorporate a GUID value into its name.

HTH,

Phil Hegedusich
Senior Web Developer
IIMAK
-----------
Boy howdy, my Liberal Studies degree really prepared me for this....
-----------
A skeleton walks into a bar, and says "I'll have a beer and a mop.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top