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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieve Database Size

Status
Not open for further replies.

TomBarrand

Programmer
Aug 9, 2000
162
0
0
GB
Is there anyway that you can find out the size of a database, last time it was backed up (any other useful info), basically the info you get if you are in Enterprise Manager and you select the Properties of a db and return this info to an ASP page for example?

Maybe there is a system stored procedure that can give some of this info?

Thanks
 
Hi Tom!

Here are some suggestions to get DB-Info by T-SQL:
Code:
exec sp_helpdb [DB-Name]

Code:
select * from sysfiles

Code:
select database_name, max(backup_finish_date) from msdb.dbo.backupset
group by database_name order by 1

Please let me know if it helps.
 
You might also want to look at sp_spaceused. Check it out in Books Online.

-SQLBill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top