Hi Guys
I pick up the following in a profiler trace.
exec
sp_cursorexecute 197, @P1 output, @P2 output, @P3 output, @P4 output,
'PSRF_REPORTING_FOLDERS', 'Jan 1 1900 12:00:00:000AM'
Normally to find the actual sql that executes i go up in the trace until i find the relevant cursor prepare. In this case the one for 197 cursor prepare.
But this time around i cannot find it, these are app servers connected so for all i know the cursor could be prepared at 5am in the morning and re-used all day long.
Is there anyway (adding certain profiler events or something), so that i can see the actual statement held in the cursor
Thanx

sp_executesql, actual sql ?
Tellek Liberty
Dr.9
fcastell
Raviatr
Hi Umachandar
Thanx for the help unfortunately there are over 16000 of these it would be impossible to find the one i am looking for.
This is worrying me since we have a very badly performing query from one of the app servers effecting production, and it is this sp_executesql , and there is no way to start troubleshooting it unless we can actually see what the sql is
Perhaps i should log a microsoft case I will if i get nothing back on this forum by monday.
Or i can try run a profiler trace for a few days and see if i can sift out the cursor preapre i ma looking for (but i know here are thousands fo these!!).
I just thought there must be an easier way of getting to the sql.
Thanx