Alternative to sp_spaceused

  • opc.three (10/5/2011)


    george sibbald (10/4/2011)


    declare @dbname sysname

    set @dbname = db_name()

    print @dbname

    select backup_start_date,backup_finish_date,backup_size/1024 as 'size in MB'

    from msdb..backupset

    where database_name = @dbname and type = 'D'

    I have just one tweak. backup_size is in bytes so the label should say 'size in KB'.

    oops, cheers.

    If you want size in MB

    declare @dbname sysname

    set @dbname = db_name()

    print @dbname

    select backup_start_date,backup_finish_date,backup_size,backup_size/1048576 as 'size in MB'

    from msdb..backupset

    where database_name = @dbname and type = 'D'

    ---------------------------------------------------------------------

  • Hi Lexa

    Have you ever tryied

    exec sp_help

    or

    exec sp_helpdb

    hope either of this sp will solve out your problem.

    Thanks & Regards
    Syed Sami Ur Rehman
    SQL-Server (Developer)
    Hyderabad
    Email-sami.sqldba@gmail.com

Viewing 2 posts - 16 through 16 (of 16 total)

You must be logged in to reply to this topic. Login to reply