I have a SQL Server 2008 instance with several databases and I\'m currently writing a C# application to access those databases. In this app, the end user can select a databa
You can query all databases from sys.sysdatabases, and check if the user has access with HAS_DBACCESS:
sys.sysdatabases
SELECT name FROM sys.sysdatabases WHERE HAS_DBACCESS(name) = 1