Index - Automatic Rebuild > 30 %

  • Jeffrey Williams (6/26/2009)


    Chris (6/26/2009)


    Wow, thats an elaborate script!!

    Ever get the following error when running it?

    "

    Procedure dba_indexDefrag_sp dropped

    Cannot add rows to sys.sql_dependencies for the stored procedure because it depends on the missing table 'SP_EXECUTESQL'. The stored procedure will still be created; however, it cannot be successfully executed until the table exists.

    "

    Chris

    No, actually I have not gotten that error before because I don't use that script. I have my own that I developed before I found hers.

    The problem is my fault - I missed the fact that you are on SQL Server 2000 and that script (I believe) was written for 2005 and greater.

    Or, are you really running 2005 and just posted in the wrong forum 🙂

    Oh boy,, Now I've done it.

    My apologies to the forum.

    I'm running SQL 2005 Ent.

    Sorry all

    Chris...

  • Chris (6/29/2009)


    Oh boy,, Now I've done it.

    My apologies to the forum.

    I'm running SQL 2005 Ent.

    Sorry all

    Chris...

    No problem, but that does mean you probably had an issue with copy/paste of the procedure. For some reason, it looks like the script you are trying to execute expects a table called sp_executesql - which is a system stored procedure that is going to get called to execute some dynamic SQL.

    At least you know that you can use that solution - once you figure out this one little issue.

    Jeffrey Williams
    Problems are opportunities brilliantly disguised as insurmountable obstacles.

    How to post questions to get better answers faster
    Managing Transaction Logs

  • Point taken.

    Thanks!!

    Chris

  • Use below statement... it will work!

    ALTER INDEX [IndexName] ON [Schema].[Tablename] REBUILD WITH (ONLINE = ON);

    It will also work for Indexes with pages less than 10.

    [font=Arial]Prakash Bhojegowda MCSE, MCSA (SQL2012)[/font]

  • Prakash.Bhojegowda (7/12/2011)


    Use below statement... it will work!

    ALTER INDEX [IndexName] ON [Schema].[Tablename] REBUILD WITH (ONLINE = ON);

    It will work for Indexes with pages less than 10.

    It works for all indexes. There's no point on indexes with < 10 pages, but you can run it.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 5 posts - 16 through 19 (of 19 total)

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