sP_cursoropen

  • I have a query that's timing out when used by one of our application users, but it doesn't we I test it against our database, I checked indexes and execution plan of the query on both databases and are the same. when i run a profiler i see that it's using sp_cursoropen, does anybody know the SP is doing and why?

     

    declare @P1 int

    set @P1=180150000

    declare @P2 int

    set @P2=8

    declare @P3 int

    set @P3=1

    declare @P4 int

    set @P4=1

    exec sp_cursoropen @P1 output, N'SELECT count(*)  FROM doc2 (NOLOCK) INNER JOIN doc2_address (NOLOCK) on doc2.doc2_id = doc2_address.doc2_id INNER JOIN address (NOLOCK) ON doc2_address.address_id = address.address_id  WHERE  ( doc2.status_cd = ''BAD'' OR doc2.status_cd = ''REL'' OR doc2.status_cd = ''REJ'' OR doc2.status_cd = ''FNG'') AND doc2.processDate BETWEEN ''01/01/1997 17:30'' AND ''01/23/2004 17:30'' AND ( address.address_text like ''%yahoo.com AND doc2_address.address_type_cd = ''FRM'' ) ', @P2 output, @P3 output, @P4 output

    select @P1, @P2, @P3, @P4

  • - Which timeout has been set by the application ?

       (and which do you use with QA)

    - This is a result of an ADO-recordset.

              Why use a recordset to perform a count(*) like this ?

     

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

Viewing 2 posts - 1 through 1 (of 1 total)

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