sp_MShasdbaccess (Transact-SQL)
Lists the name and owner of all the databases to which the user has access.
Syntax
sp_MShasdbaccess
Return Code Values
0 (success) or 1 (failure)
Permissions
Execute permission is granted to the public role.