I want to write a query which will give all the databases on the server which accessability to the user (read or more access).
Thanks, Omkar.
How about
SELECT name, HAS_DBACCESS(name) FROM sys.databases;
WHERE database_id > 4
- however this doesn't handle things like ReportServerTempDB, the new SSIS catalog, etc.
Nov 19, 2013 at 5:41