Defrag Tables

  • Comments posted to this topic are about the item Defrag Tables

  • 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.

  • 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 2 (of 2 total)

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