SELECT name FROM sys.databases WHERE database_id <= 4 /* Report Services where collation has not been changed from default Inclusion of SSRS dbs is questionable as system databases */ OR (name LIKE '%ReportServer%' AND collation_name = 'Latin1_General_CI_AS_KS_WS') /* Catch any distribution databases */ OR is_distributor = 1 /* This does't account for database_id 32767 32767 Will appear in some queries and is the mssqlsystemresource hidden db. */