sql Profile capture

  • I have sql profiler running but i am getting

    RPC Completed FETCH API_CURSOR0000000000006393

    exec sp_cursorfetch 180150073,16,1,1

    Also statement are

    declare @p1 int

    set @p1=1073741869

    exec sp_cursorprepexec @p1 output,@p2 output,N'@P1 varchar(10)',N'SELECT columns etc FROM table where = @P1 (but i know this @p1 is not this in the table

    (Wondering how i can re run this select statement but the @p1 values are not matching the data as for example the company id would be 1...not the 1073741869

    Is there a way to get the actual code of the stored procedure it is in.

    Trying to capture every line of sql code line by line.

    One of app is faling on one condition and im trying to figure out exactly what sp it is in.

    Cheers

  • Did you try to capture following event classes under StoredProcedures ?

    They will provide you more details on sql statements within stored procedures.

    SP:Starting

    SP:Completed

    SP:StmtStarted

    SP:StmtCompleted

    You probably might have done but suggesting just in case.

    V.

  • Yes got all of them - just trying to figure out how the @P1 is coming in because it not the right values got to be a unique coding for SQL Profiler but i need to true value some how

    Got to have missed one setting i am guessing in the profiler.

  • Try sp_depends 'Table Name Used in the cursor' .You'll get all the stored procedures which are using this table.

  • sp_depends not heard of this.

    Oh but i was trying to get the exact sp the sql is in when it booms out but i get fetch api and that means nothing ....

  • The Cursor operations you see are coming from an API such as ODBC. The Cursor Prepare sets up the query this cursor is executing. @p1 is the Cursor Id or Cursor handle not a parameter to the query.

    You should see Cursor execute events in your trace that have @P1 equal to the same value and meaningful values for the other parameters. I don't have an example on hand right now but as I recall the execute queries are pretty obvious when you find them. The problem is you have to back track to the Cursor Prepare Event to find the actuall query string.

    There is a lot in BOL on this topic. Start in the Index with Cursor and then scroll down for ODBC, OLE, API, etc.

    Hope this helps.

  • Oh - let me look in the profiler for that event selection cheers

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply