Determining size occupied by each row

  • We have an application that is run as an asp with each customer having an accountID assigned to them that determines what records they can and can not see. A new requirement is for us to be able to determine the space taken up within a table by each customer's records. I can figure out how to determine the amount of space an entire table takes up but not sure how to go about determining the amount of space each row takes up (with varchar and text columns).

    Any ideas?

    Thanks,

    Alex Gadea

    Apptik Inc.

  • Hmmm. Quite complicated, especially with VAR*, N*, text and nullable columns. Also the setting of text-in-row for the table would probably have an effect.

    Suggest having a look at Kalen Delaney's "Inside SQL Server 2000" - The Structure of data rows.

    If you want to do something simple, simply sum DATALENGTH(column) for each column for rows belonging to each account.


    Cheers,
    - Mark

  • Thanks, I think that might be exactly what I need. I just did a quick test and it seems to calculate out everything nicely - even the text and n* columns. If this does work, it'll wind up being a lot easier that I thought the process would be. I scoured the Books Online and couldn't find this. Thanks a lot!

    Alex Gadea

    Apptik Inc.

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

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