« first day (3182 days earlier)      last day (1669 days later) » 

5:44 AM
@CadeRoux works in PostgreSQL =)
If you join to sys.schemas, you still have to call quotename too, right?
 
 
8 hours later…
1:50 PM
@EvanCarroll potentially, yes. I thought that in postgres you can't do cross-database queries at all anyway?
 
 
4 hours later…
5:58 PM
@CadeRoux Only if you use dblink or foreign data wrapper
 
 
2 hours later…
7:46 PM
That's what I thought. There's no equivalent issue.
The issue is that I want my application database to look exactly like a customer install (i.e. it is using my existing installer process deployed to the various environments and configurations - SQL2012, SQL2016, etc) and then I want to run all my tests. So I had tSQLt and TEST schema and everything, but I don't want them in there making the database different. So all my test code and tables of tests runs from the DataMartTest DB alongside it, querying across.
Stuff that works inside the database, doesn't work when forklifted and it isn't just a matter of prefixing. And that's what's annoying.
SELECT SCHEMA_NAME(schema_id), etc FROM sys.service_queues can't just become SELECT DataMart.SCHEMA_NAME(schema_id) FROM DataMart.sys.service_queues you have to join to a DataMart.sys.schemas instead - and of course, now you have to alias the tables too because there are overlapping column names like schema_id and name. There are a bunch of functions like that which would be good if there was a server-wide equivalent (even if you had to pass the databasename to it as a parameter)
 

« first day (3182 days earlier)      last day (1669 days later) »