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

  • Home
  • SEARCH
  • 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 965813
In Process

The Archive Base Latest Questions

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

Although I have been able to see the last ran query which is a

  • 0

Although I have been able to see the last ran query which is a Stored Procedure executed but I didn’t get the parameters values with which the SP was invoked. Rather I got the following:

StoredProcedureName;1

from the following command:

DBCC INPUTBUFFER(SPID)

Where I got the SPID by viewing it in the ObjectExplorer->Management->ActivityMonitor

Is there any way I can get the complete text including the parameters with which the SP was executed ?

  • 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-16T02:03:31+00:00Added an answer on May 16, 2026 at 2:03 am

    I know this answer may not be what you are looking for, as it doesn’t really answer your question, I took a leap of thought and ended up thinking this might help.

    I don’t know how many queries you have and how big your program is… but for debugging purposes I wanted to do something similar for all of my queries, both plain text and stored procedures. So I wrote a simple wrapper class that lets me execute plain text queries/stored procs with and without parameters. Then, if an execption occurs, I trap it, build a new custom exception with the original exception plus the query that was executed and all parameters, and return it all in a custom message. I’m using Oracle in my wrapper but it’s almost exactly the same:

    Public Function ExecuteCommandQuery(ByRef oCMD As OracleClient.OracleCommand) As DataTable
        oCMD.Connection = _oConn
    
        Dim dt As New DataTable
    
        'exception if one occured'
        Dim DBException As Exception = Nothing
    
        Try
            'get an adapter'
            Dim cmd As New OracleDataAdapter(oCMD)
            'Fill the data table and ket a count of records returned'
            cmd.Fill(dt)
    
        Catch ex As Exception
            'capture exception, and rethrow after properly closing the Oracle Connection'
            DBException = ex
        Finally
            _oConn.Close()
        End Try
    
        'if exception occured, rethrow'
        If DBException IsNot Nothing Then
            Throw New Exception( _
                String.Format("A database error occured: {0} " + _
                              Environment.NewLine + Environment.NewLine + " --- " + _
                              Environment.NewLine + Environment.NewLine + _
                              " Your query: {1}" + _
                              Environment.NewLine + Environment.NewLine + " --- " + _
                              Environment.NewLine + Environment.NewLine + _
                              " Your Parameters: " + Environment.NewLine + "{2}" _
                              , DBException.ToString(), oCMD.CommandText, GenerateParameterErrorInfo(oCMD)))
        End If
    
        Return dt
    End Function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've switched over to a Mac recently and, although things have been going quite
I have been programming in Perl, off and on, for years now, although only
In Python specifically, how do variables get shared between threads? Although I have used
I know I need to have (although I don't know why) a GROUP BY
I use Delphi for many years, and although I have now moved on to
so I'm using LinQ2SQL quite heavily in my current application, and although I have
Although I don't have an iPhone to test this out, my colleague told me
I have a HashMap (although I guess this question applies to other collections) of
Although ASP.NET MVC seems to have all the hype these days, WebForms are still
I have the following code that won't compile and although there is a way

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.