Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

size of db

Status
Not open for further replies.

Bell1991

Programmer
Joined
Aug 20, 2003
Messages
386
Location
US
Is there a query i can run to find out the size of a database?

I want to find out the size of all my databases and rather than go one by one and click on properties - this would be a lot faster.

Thanks
 
sp_spaceused also works.

There is also a FAQ in this forum that describes an 'undocumented procedure' which will let you run one command against all databases. Check it out and look for MSForEachDB

-SQLBill

Posting advice: FAQ481-4875
 
Something I saw somewhere..

SELECT name AS NameOfFile,
size/128.0 -CAST(FILEPROPERTY(name, 'SpaceUsed' )AS int)/128.0 AS AvailableSpaceInMB
FROM dbo.SYSFILES

If the DBs are linked you could run it from one spot.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top