Solved

SQL - Create a temporay table

Posted on 2007-12-05
1
217 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
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…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

730 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