Calculating Disk space used by part of a Table

  • I'm using SQL server 2k on a shared server. I need to calculate, in

    realtime, the actual disk space used by a portion of my "Products" table

    (e.g. finding how much space is used by products belonging to a specific

    category).

    Can I retrieve this info from within a classic ASP/VBscript app?

    Any help greatly appreciated.

    --

    Vic

  • This was removed by the editor as SPAM

  • Depending on the size of the table u could

    select column1,column2 into products where blah blah

    create table Spacetemp (name nvarchar(255),

    rows nvarchar(100),

    reserved nvarchar(255),

    data nvarchar(255),

    index_size nvarchar(255),

    unused nvarchar(255)

    )

    insert Spacetemp (name,rows,reserved,data,index_size,unused) exec sp_spaceused 'products'

    select * from Spacetemp

    drop table Spacetemp

    drop table products

    nice and ugly and quick and dirty!


    Andy.

  • Andy, Thanks for replying, I'll try your suggestion later today.

    Vic

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

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