partof stored procedure running slow

  • hi

    this is the part of a stored procedure running slow. could you please explain me the reason?

    declare @p1 int

    set @p1=259

    exec sp_prepexec @p1 output,N'@P0 int',N'SELECT bRoot.BeanVersion col0, bRoot.CreateTime col1, bRoot.CreateUserID col2, bRoot.GroupType col3, bRoot.ID col4, bRoot.KFB_AgencyName col5, bRoot.KFB_CCLive col6, bRoot.KFB_ClaimBranch col7, bRoot.LoadFactor col8, bRoot.Name col9, bRoot.OrganizationID col10, bRoot.PublicID col11, bRoot.Retired col12, bRoot.SecurityZoneID col13, bRoot.SupervisorID col14, bRoot.UpdateTime col15, bRoot.UpdateUserID col16, bRoot.ValidationLevel col17, bRoot.WorldVisible col18 FROM cc_group bRoot WHERE bRoot.ID = @P0 ',357

    select @p1

    thanx

  • Is that the actual code from the stored procedure or is that from a trace?

    It might be better if you provided the code for the entire stored procedure, we might get a better idea of what is going on.

    😎

  • Like Lynn said this looks like it's from a trace. Not only that but from some reporting tool (Crystal, RS) from another server. IF this is indeed from a trace, look particularly at the number of READS and also Writes.

  • Check the execution plan for the query. Findout if it's using proper index or not.

    Also you can use DTA (Database Engine Tunning Advisor).

    ---------------------------------------------------
    "Thare are only 10 types of people in the world:
    Those who understand binary, and those who don't."

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

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