Solved

SQL - Create a temporay table

Posted on 2007-12-05
1
227 Views
Last Modified: 2013-12-24
I need help creating a temporary MS SQL 2000 table in coldFusion. I keep having trouble with the syntax.  The "#" sign is giving me trouble. When i remove the "#" sign it creates an actual table in the DB.

<cfquery name="createTempTable" datasource="#dbname#" username="#dbuser#" password="#dbpw#">
CREATE TABLE #tmp_report_table
(      name      VARCHAR(30),
      id      VARCHAR(30),
)
</cfquery>
0
Comment
Question by:Wirt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 36

Accepted Solution

by:
SidFishes earned 500 total points
ID: 20413321
couple of things

you've an extra comma at end of id      VARCHAR(30), <----
and you need to escape the # with ## for CF to not throw an error


<cfquery name="createTempTable" datasource="#dbname#" username="#dbuser#" password="#dbpw#">
CREATE TABLE ##tmp_report_table
(      name      VARCHAR(30),
      id      VARCHAR(30)
)
</cfquery>
0

Featured Post

Monthly Recap

May was a big month for new releases from Linux Academy! Take a look at what our team built recently in our blog. You can access the newest releases from our blog.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question