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
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: