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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:29:15+00:00 2026-05-26T04:29:15+00:00

I need to build a service which expose metadata about stored procedures in an

  • 0

I need to build a service which expose metadata about stored procedures in an sql server database.
Is there any way to find out which stored procedure return sets, and which don’t, so they can be called, correspondingly, through ExecuteReader or ExecuteNonQuery?

Thank you

  • 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-26T04:29:15+00:00Added an answer on May 26, 2026 at 4:29 am

    It turns out (I Googled) that the way to do this is to set the FMTONLY FLAG to ON on Sql Server.

    See here.

    Here’s an example taken from here:

    SET FMTONLY ON;
    
      EXEC dbo.MyTestSproc @param1 = NULL, @param2 = NULL, @param3 = NULL
    
    SET FMTONLY OFF;
    

    In the case where a stored proc does not return any data, you won’t see any output (at least that was my observation in SSMS). When the proc does return data, you see the column names being displayed without actually anything being returned.

    So it is sort of a trial an error kind of thing.

    NOTE: I tested with a proc that uses a table-valued parameter and it did not produce any output even though the proc does return data. Setting the parameter to NULL did not work and SSMS complained with a nasty error. The error seems to be related to a temp table being used inside the proc and not necessarily with the table-value parameter but still didn’t produce the empty resultset:

    Msg 208, Level 16, State 0, Procedure spWhatever,
    Line 20 Invalid object name ‘#temp’.

    Looking at the link posted by Michael, it appears that if the proc returns different result sets depending on a parameter passed in, for example, it’s impossible to know with certainty. See Marc Gravell’s answer.

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

Sidebar

Related Questions

I need to build very concurrent web service which will expose REST based API
1. I need to build a Web Service Server (Simulator) which generates the xml
I need to build some client side code which follows this use case: An
I need to build a multidimensional array from records retrieved from my database. Here
I'm going to build a little service which monitors an IMAP email account and
Given a public SOAP web service and no WSDL, I need to build a
I need to build Android application using Java which is able to send request
I have sybase stored procedures that I have written which we use in our
We are planning to build an Android app which interacts with a web service.
I have a RIA service (CustomDomainService), which is composed by few methods that need

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.