February 22, 2010 at 4:23 am
i have a sproc that builds up a sql statement and executes it using sp_executeSql.
I need to find out the exact sql statement that is being executed by sp_executeSql.
The main sproc is called by a web site. I have tried tracing for the following events:
TSQL:
exec prepared sql
sql:BatchStarting
Sql:StmtStarting
Unprepare SQL.
Stored Procedures:
RPC:Starting
SP:StmtStarting
None of these show me the code that is being executed by the sp_executeSql. Can anyone advise what im doing wrong here?
February 22, 2010 at 4:28 am
They should show in those , are you sure you are not filtering them out on another condition
February 22, 2010 at 7:33 am
I'm not sure, but I would guess that you are missing it because you are filtering based on an application, user, or database. In a simple test I am seeing my execution using SP:StmtCompleted and I have no filters on the trace.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply