Wednesday, March 21, 2012

DB size and used space?

Do you know where I can get allocated and used space for one database?
I've already got allocated space from sp_helpdb, but can't find any reference to used space.
Thanks in advance,
Csar.RE:
Q1 Do you know where I can get allocated and used space for one database? I've already got allocated space from sp_helpdb, but can't find any reference to used space. Thanks in advance, Csar.

A1 Yes.

One way to determine allocated and used DB space is to use the special stored procedure sp_SpaceUsed, for example:

Use Pubs
-- Entire Pubs DB:
Exec sp_SpaceUsed
@.updateusage = 'True'
Go

-- Authors table only:
Exec sp_SpaceUsed
@.objname = 'Authors',
@.updateusage = 'True'

No comments:

Post a Comment