-
Retrieve database size information
On the General tab of a database properties screen there are two fields:
Size and Space Available. Is there a way to access the two fields
programmatically? This would be an easy way to keep track of when the
database needs to be grown.
Thanks,
-
Re: Retrieve database size information
Try sp_spaceused at query analyser (after selecting the target database).
Roberto.
"Tim Kelley" wrote in message
news:OOr%23yloKHHA.1248@TK2MSFTNGP02.phx.gbl...
> On the General tab of a database properties screen there are two fields:
> Size and Space Available. Is there a way to access the two fields
> programmatically? This would be an easy way to keep track of when the
> database needs to be grown.
>
> Thanks,
>
>
>
-
Re: Retrieve database size information
Try sp_spaceused at query analyser (after selecting the target database).
Roberto.
"Tim Kelley" wrote in message
news:OOr%23yloKHHA.1248@TK2MSFTNGP02.phx.gbl...
> On the General tab of a database properties screen there are two fields:
> Size and Space Available. Is there a way to access the two fields
> programmatically? This would be an easy way to keep track of when the
> database needs to be grown.
>
> Thanks,
>
>
>
-
Re: Retrieve database size information
Tim
sp_helpdb 'dbname'
"Tim Kelley" wrote in message
news:OOr%23yloKHHA.1248@TK2MSFTNGP02.phx.gbl...
> On the General tab of a database properties screen there are two fields:
> Size and Space Available. Is there a way to access the two fields
> programmatically? This would be an easy way to keep track of when the
> database needs to be grown.
>
> Thanks,
>
>
>
-
Re: Retrieve database size information
Tim
sp_helpdb 'dbname'
"Tim Kelley" wrote in message
news:OOr%23yloKHHA.1248@TK2MSFTNGP02.phx.gbl...
> On the General tab of a database properties screen there are two fields:
> Size and Space Available. Is there a way to access the two fields
> programmatically? This would be an easy way to keep track of when the
> database needs to be grown.
>
> Thanks,
>
>
>
-
Re: Retrieve database size information
Hello,
To get the space allocated and usage you could use below commands:-
FOR Data files - SP_SPACEUSED
For LDF files- DBCC SQLPERF(LOGSPACE)
For SQL 2005; use the below Dynamic management view (DMV)
sys.dm_os_performance_counters
THanks
Hari
"Tim Kelley" wrote in message
news:OOr%23yloKHHA.1248@TK2MSFTNGP02.phx.gbl...
> On the General tab of a database properties screen there are two fields:
> Size and Space Available. Is there a way to access the two fields
> programmatically? This would be an easy way to keep track of when the
> database needs to be grown.
>
> Thanks,
>
>
>
-
Re: Retrieve database size information
Hello,
To get the space allocated and usage you could use below commands:-
FOR Data files - SP_SPACEUSED
For LDF files- DBCC SQLPERF(LOGSPACE)
For SQL 2005; use the below Dynamic management view (DMV)
sys.dm_os_performance_counters
THanks
Hari
"Tim Kelley" wrote in message
news:OOr%23yloKHHA.1248@TK2MSFTNGP02.phx.gbl...
> On the General tab of a database properties screen there are two fields:
> Size and Space Available. Is there a way to access the two fields
> programmatically? This would be an easy way to keep track of when the
> database needs to be grown.
>
> Thanks,
>
>
>