sp_cursorprepexec what is it doing?

  • WHEN SQL profiling I see this code popping up it takes 5-10 seconds to run, but i do not understand what is doing? Why is the the code being excuted through sp_cursorprepexec ?

    When its excuted by it self it takes a few mil seconds. what are all those paramters for? where do they go? Why is sp_cursorprepexec used?

    Many thanks

    declare @P1 int

    set @P1=4211

    declare @P2 int

    set @P2=180151118

    declare @P3 int

    set @P3=1

    declare @P4 int

    set @P4=1

    declare @P5 int

    set @P5=12

    exec sp_cursorprepexec @P1 output, @P2 output, NULL, N'Select r.READCODE, r.APPLIEDFROMDATE, r.RCTEXT, r.FREETXT, r.EPILINEKEY, ci.ENTEREDBY, ci.ACCESSLEVEL from SC_READCODES r left outer join SC_CONFIDENTIAL ci on r.EPILINEKEY = ci.EPILINEKEY where r.PATIENTKEY = ### and r.SIGNIFICANT = 1 and len(isnull(convert(varchar(10), r.APPLIEDTODATE, 103), '''')) = 0 order by r.APPLIEDFROMDATE desc

    ', @P3 output, @P4 output, @P5 output

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

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

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