Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8212965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:57:05+00:00 2026-06-07T10:57:05+00:00

I am using Coldfusion 9 and SQL Server 2008. I’m trying to learn the

  • 0

I am using Coldfusion 9 and SQL Server 2008. I’m trying to learn the platforms and really learn how to effectively leverage both platforms for a reporting solution. I’ve had some big challenges with stored procedures, or sprocs. All I want is a really simple answer to get my sprocs to the point where I can leverage them in CFML and get data to the people who need it.

I’ve done some research online and it appears that SQL Server 2008 takes advantage of temporary tables that are placed into RAM (@) or written to disk for a local user(#). My problem is that I can’t seem to get the generated temp table to return data back to ColdFusion from the process call, Although when I run the portion of the SQL query that gets added to the temporary table in SQL Server it works like a charm. All I want to do is return a simple table to ColdFusion and ensure I am coding this in the most efficient manor possible.

I’ve tried:
– Using the Return statement, but this seems to generate syntax errors with RAM tables (@).
– Using Persistent Temp Tables (#) – Though various online forums seem to think by using this an application takes a big performance hit by doing this. (Everyone’s a critic.)

My goals are:
– To learn this process as well as I can to re-use it as much as I can
– Learn the right way to do this so the query performs as well as it can.
– Understand under what situations I use (@) and (#) temp tables in SPROCS and why. Some think that persistent temp tables (#) are better because it frees ram up for other sprocs fired during the compilation, while others think having the server go to the hard disk to write data is slower.
– Understand why the syntax below doesn’t work

Currently my CFML code looks like this:

<!--- ===========================================================================================================================
================================================= Page Resources ================================================================
=============================================================================================================================--->
<CFSTOREDPROC datasource="PoliticalDonationsDB" procedure=" sp_GetCurrentDonationCount_withDateRange" result="DONATIONCOUNT">
    <!--- In --->
    <cfprocparam cfsqltype="INT" dbvarname="SDate" value="2004">
    <cfprocparam cfsqltype="INT" dbvarname="EDate" value="2005">
    <!--- OUT --->
    <cfprocresult name="DonationCount">
</CFSTOREDPROC>

<!--- ===========================================================================================================================
================================================= Page Display ==================================================================
=============================================================================================================================--->

<HTML>
    <HEAD>
        <TITLE><CFOUTPUT>Title</CFOUTPUT></TITLE>
    </HEAD>

    <BODY>

        <div id="logo">
        </div><!--- End logo div --->

        <div id="currentRecords">
            <CFDUMP var="#VARIABLES#">
            <CFDUMP VAR="#DONATIONCOUNT#">
        </div><!---End currentRecords--->

        <div id="navigation">
            <ul>
                <li>Companies</li>
                    <ul>
                        <li></li>
                    </ul>
            </ul>
        </div><!--- End navigation div--->

        <div id="statisticsTab">
        </div> <!--- End Statistics div--->

    </BODY>
</HTML>

And My SQL Server code looks like this:

Use Politics 
GO

ALTER procedure sp_GetCurrentDonationCount_withDateRange
@SDate AS int,
@EDate AS int
AS
BEGIN
    --Create RAM Table
    DECLARE @DonationCountTable TABLE
    ( donationKey INT,
      CompanyKey INT,
      SenatorKey INT,
      donationAmount MONEY,
      donationDateFY INT
    )

    --Put the stuff into the RAM table
    INSERT INTO @DonationCountTable (donationKey, CompanyKey, SenatorKey, donationAmount, donationDateFY)
    SELECT * FROM PoliticalDontations
    WHERE donationDateFY BETWEEN @SDate AND @EDate
    ORDER BY donationDateFY, CompanyKey ASC

    --Get the stuff out of the RAM Table
    SELECT * FROM @DonationCountTable
END
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T10:57:07+00:00Added an answer on June 7, 2026 at 10:57 am

    You need this:

    <cfprocparam cfsqltype="CF_SQL_INTEGER" value="2004">
    

    DBVARNAME is deprecated:
    http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_p-q_14.html

    Here is a list of acceptable CFSQLTYPES

    CF_SQL_BIGINT
    CF_SQL_BIT
    CF_SQL_BLOB
    CF_SQL_CHAR
    CF_SQL_CLOB
    CF_SQL_DATE
    CF_SQL_DECIMAL
    CF_SQL_DOUBLE
    CF_SQL_FLOAT
    CF_SQL_IDSTAMP
    CF_SQL_INTEGER
    CF_SQL_LONGVARCHAR
    CF_SQL_MONEY
    CF_SQL_MONEY4
    CF_SQL_NUMERIC
    CF_SQL_REAL
    CF_SQL_REFCURSOR
    CF_SQL_SMALLINT
    CF_SQL_TIME
    CF_SQL_TIMESTAMP
    CF_SQL_TINYINT
    CF_SQL_VARCHAR
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using SQL Server 2008 and ColdFusion 9.1.2. I have a query that
Using SQL Server 2008... I'm having some troubles in trying to order my rows
I am using Coldfusion 8 which is connecting to SQL Server 2008, the problem
I am using SQL Server 2008 Enterprise. I met with issue which says line
I am using SQL Server 2008 Enterprise for development. I find from SQL Server
I am using ColdFusion 9.0.1 and SQL Server 2005. The column in my database
I am using SQL Server 2008 Enterprise. I am learning OUTPUT parameter of SQL
I am using FlashBuilder 4.6, coldfusion 9 and Sql Server 2005 to populate a
I'm using ColdFusion with Microsoft SQL Server 2005 and on occasion I get this
I am working with ColdFusion 9 on a Windows Server, using MS SQL Server

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.