title sp_MShasdbaccess (Transact-SQL) | Microsoft Docs ms.custom ms.date 03/14/2017 ms.prod sql-non-specified ms.reviewer ms.suite ms.technology database-engine ms.tgt_pltfrm ms.topic language-reference f1_keywords sp_MShasdbaccess sp_MShasdbaccess_TSQL dev_langs TSQL helpviewer_keywords sp_MShasdbaccess ms.assetid a9a23b90-2c60-4460-80a7-d7e14cc5a6a8 caps.latest.revision 14 author BYHAM ms.author rickbyh manager jhubbard sp_MShasdbaccess (Transact-SQL) [!INCLUDEtsql-appliesto-ss2008-xxxx-xxxx-xxx_md] Lists the name and owner of all the databases to which the user has access. Applies to: [!INCLUDEssNoVersion] ([!INCLUDEssKatmai] through current version). Transact-SQL Syntax Conventions Syntax sp_MShasdbaccess Return Code Values 0 (success) or 1 (failure) Permissions Execute permission is granted to the public role. See Also sys.sysdatabases (Transact-SQL)