asp.net - How to view the last ran sql query from SqlClient data provider on Sql server 2000? -


After

Although I have been able to see the last running query which is performed on a stored procedure, but I have parameter value Not found in which SP was implemented.

  StoredProcedureName; 1  

By the following order: I got the following

  BCC INPUTBUFFER (SPID)  

I Where to find SPID by seeing it in ObjectExplorer-> Management> ActivityMonitor

Any method can get full text including parameters, with which SP was executed?

"itemprop =" text ">

I know, this question can not be answered for what you are not looking for In the form of not really answering your question, I thought that I took a leap and it ended up thinking that it could help.

I do not know how many questions you have and how big your program is ... but for purposes of debugging I want to do something similar to all my questions, plain text and stored procedures both. So I wrote a simple wrapper class that allows me to execute plain text queries / mount processes without parameters and without execution. After that, if any execution happens, then I create it, creates a new custom exception with the original exception, which returns the query and all the parameters executed, and everyone in the custom message. I am using Oracle in my wrapper, but it is almost ok:

Public Function ExecuteCommand DataTable oCMD.Connection = _OConn Dim (oCMD OracleClient.OracleCommand as ByRef) DT
 New As a 'exception, if any' as an exception, DBException 'Try Nothing' as a new Oracleadata Adapter (OCMD) fill in the 'Receive DMCDD' data table and record counts' CMD. Fill out (DT) expansion as 'capture exception', and rerrow after properly ending the 'Oracle connection' DBException = ex end _oConn.Close () 'If the exception occurred, rethrow' DBException IsNot nothing then new Exception throw (_ String.Format ("A database error occurred: {0}" + Environment. Newline + Environment. NewLine + "---" + Environment. New Line + Environment. NewLine + _ "Your query: {1} "Environment + New Line + Environment. New Line +" --- "+ Environment. New Line + Environment. NewLine + _" Your Paramet : "+ Environment. NewLine +" {2} "_, DBException.ToString (), oCMD.CommandText, GenerateParameterErrorInfo (oCMD)) Finally return DT ending function  

Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -