Size of Filtered Table

  • I would like to get the size of the tables in my database BUT as follows:

    SIZE OF (SELECT * FROM myTable WHERE Section = 1)

    ...what is the fastest way to do it?

  • I'm on my phone now, otherwise I'd provide an example....

    You could take the last backup and restore it somewhere else (a non-production machine preferably). Then you could create a Dynamic SQL query that makes an exact copy of those tables and only inserts rows with section=1 values. Then you could get the size of those.

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • Not what I am looking for.

    I have a set of tables constantly updated from different customers and I need to know how much space each customer is using

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

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