Ever wonder which databases you can actually get into? There's a simple SQL query that'll show you exactly which ones are accessible on your system. It's a quick way to check your database permissions at a glance.
SELECT name, HAS_DBACCESS(name) FROM sys.databases;
This statement lists each database by name and tells you whether you have access to it. Pretty handy for a quick security check!