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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:33:16+00:00 2026-05-31T15:33:16+00:00

I want to access the stored procedure script using C#. I used EXEC sp_HelpText

  • 0

I want to access the stored procedure script using C#.

I used EXEC sp_HelpText STOREDPROCNAME. This is working fine.

Is there any way to retrieve stored procedure query and the stored procedure parameter separately??

ex: I need:

delete from [dbo].[tblTransactions] where [ID] = @ID

and

@ID numeric(18,0)

separately.

How to do this?

  • 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-31T15:33:17+00:00Added an answer on May 31, 2026 at 3:33 pm

    You can get the body this way, but there isn’t a way to parse out the individual statements:

    SELECT definition FROM sys.sql_modules 
    WHERE [object_id] = OBJECT_ID('dbo.procedurename');
    

    You can get its parameters by:

    SELECT name, system_type_id, max_length, precision, scale
    FROM sys.parameters
    WHERE [object_id] = OBJECT_ID('dbo.procedurename');
    

    Note that you can’t determine without brute force parsing of the definition whether the parameters have a default value, and if they do, what the default value is. You are better equipped to do these things in C# using RegEx or other parsing methods, or PowerShell like the ParamParser project I started here.

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

Sidebar

Related Questions

I want to give a user access to a stored procedure, but not to
HI all, Iam using VS2008 and SQL2008 i want to access my stored procedures
I want to create temporary table in stored procedure and access it in the
How to do transaction control on data access using DataAdapter and Stored Procedure in
I want to execute stored procedure with one parameter that returns table using EF4
I want to pass xml document to sql server stored procedure such as this:
I want to access an image stored in Blackberry, say at location store/home/user/image.png .
I am calling an 2005 MS SQL Server stored procedure using the MS JDBC
I have a stored procedure. I want to call a function from it. Want
I've got a stored procedure which runs this to create a new ticket number:

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.