Blog

  • Find the tables that use the most disk space in SQL SERVER

    Simply start a new query window for the database and use the statement below:

    SELECT object_name(i.object_id) as objectName,
    i.[name] as indexName,
    sum(a.total_pages) as totalPages,
    sum(a.used_pages) as usedPages,
    sum(a.data_pages) as dataPages,
    (sum(a.total_pages) * 8 ) / 1024 as totalSpaceMB,
    (sum(a.used_pages) * 8 ) / 1024 as usedSpaceMB,
    (sum(a.data_pages) * 8 ) / 1024 as dataSpaceMB
    FROM sys.indexes i
    INNER JOIN sys.partitions p
    ON i.object_id = p.object_id
    AND i.index_id = p.index_id
    INNER JOIN sys.allocation_units a
    ON p.partition_id = a.container_id
    GROUP BY i.object_id, i.index_id, i.[name]
    ORDER BY sum(a.total_pages) DESC, object_name(i.object_id)
    GO
  • Nice tweak settings for Windows XP Pro (gpedit.msc)

    1. Start – Run – type gpedit.msc.

    2. Go to User Configuration – Administrative Templates – Windows Components – Windows Explorer.

    3. There you will find many settings to play with! ( only for network administrators )

    4. You may need to reboot the computer for settings to take place.