Database Solutions
Wednesday, October 19, 2011
Find databases without any owners
SELECT @@SERVERNAME AS ServerName
, [name] as DBName
, SUSER_SNAME(sid) as CurrentDBOwner
FROM sysdatabases
WHERE SUSER_SNAME(sid) is null
OR SUSER_SNAME(sid) = ''
No comments:
Post a Comment
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment