SQL Server and MySQL Notes
Pages
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
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment