then trying a SELECT on one of the tables in each database. If I don't have permission to use the database, I get an exception and move on to the next.
select name from master..sysdatabases where name <> 'master' and name <>'tempdb' and name<>'model' and name<>'msdb'
Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>