To cut this topic...
I was thinking about how "Microsoft" identifies its own system databases, maybe there are some
hidden flags, but how to find them and how do they do that?
As you all know within SSMS when you expand certain folder subtrees, a specific T-SQL code
is generated to represent various objects. You are able to see this commands when you (of course)
run SQL Profiler.
And this is the WHERE part of the t-sql code when you expand "Databases\System Databases" :
(CAST(case when dtb.name in (''master'',''model'',''msdb'',''tempdb'') then 1 else dtb.is_distributor end AS bit)=@_msparam_0 and.......