MSUser (MSUser@discussions.microsoft.com) writes:
> when textData is:
>
> exec sp_execute <number> @xx=2222 @yy=3333
>
> Is there a way to find the sql behind the sp_execute?
If there is an "sp_prepare" with the same number in the thread, there is.
If you include sql_handle in the trace, you look can up the text for the
cache entry. Or? No, you probably only get the call to sp_execute.
I don't remember if you see the individual statements if you include
StmtCompleted, but I have a nagging feeling that you don't.
--
Erland Sommarskog, SQL Server MVP, esquel.RemoveThis@sommarskog.se
Links for SQL Server Books Online:
SQL 2008:
http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005:
http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000:
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx