Logging database sizes plus the DBO of the database.

  • Hi

    I am a very new SQL DBA and I am wondering if anyone can give me a shove in the right direction! 😉

    I have been asked by management to write a script that will tell me the size of each database on my server tied to the DBO of the database. I am getting great info from sp_databases but I am not sure how to tie this up with a list of the database users. I have discovered sp_helpuser but this is database specific.

    Can anyone give me a hint to get me started?!

    Many thanks!

    Fraggle

  • select a.name,(sum(b.size)*8)/1024,SUSER_NAME(a.owner_sid)

    from master..sysaltfiles b, master.sys.databases a

    where A.database_id=B.dbid

    group by a.name,a.owner_sid

    order by 1

    Cheers,
    Sugeshkumar Rajendran
    SQL Server MVP
    http://sugeshkr.blogspot.com

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

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