Is there a way to list the owners of all databases? Right clicking in Ent
Manager and selecting properites is TOO time consuming!
select name,suser_sname(sid) as 'owner'
from master.dbo.sysdatabases
However, if databases are restored/attached you might not get a match for
suser_sname(sid)
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Jay Griffin" <JayGriffin@.discussions.microsoft.com> wrote in message
news:EC0435CD-9517-47E2-89F6-C98435AA815E@.microsoft.com...
> Is there a way to list the owners of all databases? Right clicking in Ent
> Manager and selecting properites is TOO time consuming!
|||Thank you Jasper!
"Jasper Smith" wrote:
> select name,suser_sname(sid) as 'owner'
> from master.dbo.sysdatabases
> However, if databases are restored/attached you might not get a match for
> suser_sname(sid)
> --
> HTH
> Jasper Smith (SQL Server MVP)
> http://www.sqldbatips.com
> I support PASS - the definitive, global
> community for SQL Server professionals -
> http://www.sqlpass.org
> "Jay Griffin" <JayGriffin@.discussions.microsoft.com> wrote in message
> news:EC0435CD-9517-47E2-89F6-C98435AA815E@.microsoft.com...
>
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment