In an answer to Strange new database 'Data.StackExchangePOC' is messing up cross-site SEDE queries our DBA extraordinair Aaron Bertrand suggested to have a feature request for a view to list databases that can safely be used in a multi-database query.
For context, multi-database queries are possible by doing some nifty trickery that rely on the meta-data found in the sys
schema of SQL Server. These tricks fail when unexpected databases show up (1, 2, 3 , 4)
There have been prior proposals to add extra meta-data to the schema, for example:
This feature request is explicitly not a duplicate of any of those prior requests. I'm asking here to implement exactly what Aaron suggested and only that as I assume that can be done now and not in 6 to 8 weeks.
So without further ado here is Aaron's proposal:
A feature request that would likely be easy for me to implement would be a view that provides a list of databases that:
- are not system databases
- are not secret POC databases
- are online
- are accessible by
svc_sede
- contain a
Posts
tableThis would present you with a reliable list that will be updated when new sites are added. It would really reduce the grunt work in queries like Glorfindel's, and prevent you from having to parse this question for that same list. In fact, the view could be used to generate the markdown in that question.
Please create that view for us.