SQL Server and MySQL Notes
Pages
(Move to ...)
Home
Contact Me
All Articles
Author Profile
Download Links
How to be DBA?
▼
Monday, January 24, 2011
Script to calculate DB size and available size
SELECT
Db_name
(
)
AS
dbname
,
name
AS
filename
,
size
/
128.0
AS
currentsizemb
,
size
/
128.0
-
CAST
(
Fileproperty
(
name
,
'SpaceUsed'
)
AS
INT
)
/
128.0
AS
freespacemb
FROM
sys
.
database_files
;
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment