Defrag Tables

  • rsharma

    SSCarpal Tunnel

    Points: 4865

    Comments posted to this topic are about the item Defrag Tables

  • Brett Burton

    Grasshopper

    Points: 21

    This works great... thanks for posting it. The only difference that I had to make was to add the table_schema to the cursor.

    DECLARE PKMS_Tables CURSOR LOCAL FOR

    select (table_schema + ''.'' + table_name) as table_name from information_schema.tables

    where table_type = ''base table'' order by 1

    I have tables that are not dbo.

  • Ajay Prakash

    SSC Eights!

    Points: 891

    Good efforts. Adding some rebuild decision criteria eg. Physical fragmentation gone more that 10% or logical fragmentation gone more than 15% might have been better.


    Kindest Regards,

    Ajay Prakash

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

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