I have two different system databases: Management_Reporting and MPS.
I need some tables from Management_Reporting.dbo.TreatmentSummary and MPS.dbo.BloodTest.
I tried UNION ALL, but there are different numbers of fields within dbo.TreatmentSummary and dbo.BloodTest.
How do I query another system database from another?
I can easily query one database from another within the same system database, but this one eludes me.
Replies to replies: @siggemannen apologies - I used the right term in the next line... was concentrating on trying to explain the relationships - whoops!
@Charlieface I had expected results in my original post, but they were edited out by someone else. I have Management_Reporting.dbo.TreatmentSummary which contains columns like PatientID, DrugRegime etc, and then MPS.dbo.BloodTest containing PatientId and blood results like FSH, E2, P4 etc. I need to query these combined results. I don't think work would like me posting sample data sorry.
@ThomA I'll look into that, thank you
edited again to further clarify:
@ThomA these are contained databases... do you have any ideas or pointers, please?