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 7892769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:57:01+00:00 2026-06-03T06:57:01+00:00

I have a user defined function in my MS SQL(2005) that I would like

  • 0

I have a user defined function in my MS SQL(2005) that I would like to execute through Coldfusion (8).
Any idea how I can get this to work?

[It’s not a stored procedure, so cfstoredproc is out] .

Thank you in advance.

  • 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-03T06:57:03+00:00Added an answer on June 3, 2026 at 6:57 am

    You can call the SQL UDF right inside a regular CFQUERY block, assuming your Coldfusion datasource has appropriate EXECUTE permissions on the desired UDF. You don’t have to return a select statement inside of CFQuery. Remember to use CFQUERYPARAM for safety if you are passing any Coldfusion variables to the database.

    To call the UDF, you need to include its schema*. In our case, we used the default schema, so our UDFs are prefixed with “dbo.” as in dbo.FunctionName().

    Here is an example:

    <!--- We want to convert this numeric category into its English name.
          Thankfully our database administrator has a simple function to 
          resolve it without extra work on our part. --->
    
    <cfset myCategory = 100428>
    
    <!--- We call this Coldfusion variable using CFQUERYPARAM to prevent SQL Injection --->
    
    <cfquery datasource="mydatasource" name="test">
      SELECT dbo.CategoryAsString(<cfqueryparam cfsqltype="cf_sql_integer" value="#myCategory#">) AS CategoryString
    </cfquery>
    
    <!--- And output the result here --->
    <cfdump var="#test.CategoryString#">
    

    *If you don’t include the UDF’s schema, you will get an “Error Executing Database Query.
    [Macromedia][SQLServer JDBC Driver][SQLServer]'[FUNCTION NAME]’ is not a recognized built-in function name.” (CF 8)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using SQL Server 2008 and would like to have a user defined function
I have an user defined table function in SQL Server that aggregate data from
I'm trying to code a user defined function under SQL Server 2005 that will
I have been writing a user-defined function in SQL Server: It looks like this
I have a user defined function in a SQL Server 2005 database which returns
I have a class that defined a user defined operator for a TCHAR*, like
I have a user defined function (e.g. myUDF(a,b) ) that returns an integer. I
I have a user defined function in SQL called getBuisnessDays it takes @startdate and
I have a User defined function in SQL Server 2008. Here it is: CREATE
I have created user-defined function that converts a comma-delimited string into a table. I

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.