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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:04:06+00:00 2026-05-26T20:04:06+00:00

I need to surpress messages output from a SQL function. As in 1 row

  • 0

I need to surpress messages output from a SQL function. As in 1 row affected. I can’t use SET NOCOUNT as it’s invalid in a function.

Anyone know a way to do this?

Thanks.

EDIT

I was trying to limit the background information in an attemp to boil the problem down to it’s essence. But I’ll expand. I’m using MSSQL2005 and NHibernate to insert a record in to a SQL table. On the table I have a computed column that runs the function which is reporting back 1 row affected.

I didn’t really want to edit the NHibernate part of the process but it may be unavoidable.

  • 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-05-26T20:04:07+00:00Added an answer on May 26, 2026 at 8:04 pm

    A function that returns “(1 row affected)” will be part of a bigger query in a batch. It makes no sense to have SET NOCOUNT ON in the function

    You need to do this:

    SET NOCOUNT ON;
    SELECT * FROM MyUDFTVF();
    

    Note a stored procedure is simply a wrapper for this

    CREATE PROC Whatever
    AS
        SET NOCOUNT ON;
        SELECT * FROM MyUDFTVF();
    GO
    

    SET NOCOUNT ON is normally needed to stop triggers etc breaking client code: why do you need it here?

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

Sidebar

Related Questions

I need to suppress a specfic compiler warning in C#. Now I can do
Need a function that takes a character as a parameter and returns true if
Need a function like: function isGoogleURL(url) { ... } that returns true iff URL
Need to call a filter function on some options based on a radio selected
I've got this code throwing an error from an iframe: function parentIframeResize() { var
I made a function like this (no need to write the whole function here)
I need a set of wrappers around the standard system calls-open,listen,etc. For these i
I need some advice here, I hope somebody can help me. I have the
Need a way to allow sorting except for last item with in a list.
Need to an expression that returns only things with an I followed by either

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.