+ Reply to Thread
Results 1 to 7 of 7

Retrieve database size information

  1. 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,




  2. 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,
    >
    >
    >




  3. 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,
    >
    >
    >




  4. 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,
    >
    >
    >




  5. 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,
    >
    >
    >




  6. 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,
    >
    >
    >




  7. 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,
    >
    >
    >




+ Reply to Thread