T-SQL / Space Used only from the DataFile

  • How can i obtain with T-Sql the size of the useage only form the DataFile - including the size for keys. Should deliver the same size like Enterprise Manager \ view Taskpad

    Thanks in advance

    Jürgen

  • You can use DBCC SHOWFILESTATS

    The column UsedExtents will give you the information you're looking for. Since there are 64K in an extent, the calculation for used space for data in MB will be:

    UsedExtents * 64/1024

    -mr

  • GREAT answer - thank you very much

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

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