ntgOne
asked on
SQL Development
Hello -
I am not all a SQL expert but have to create a query which displays data from 2 different databases.
Please see attached image -
I have Database A Table 1 which lists my applications and their job execution status
I have Database B Table 1 which lists my application availability status
As shown in attachment I need to join each database and table in question for 1 report which shows both application availability along with each applications total failed job count along with availability for past day as opposed to every hour of the day.
The only way I am able to relate both tables is via part of the application name being in the the job_name column of Database A and AppName column of Database B. For example "App1"
I have no idea if / how it is possible to join 2 databases where as in this case the common application name not represented the same way in each database.
I am not all a SQL expert but have to create a query which displays data from 2 different databases.
Please see attached image -
I have Database A Table 1 which lists my applications and their job execution status
I have Database B Table 1 which lists my application availability status
As shown in attachment I need to join each database and table in question for 1 report which shows both application availability along with each applications total failed job count along with availability for past day as opposed to every hour of the day.
The only way I am able to relate both tables is via part of the application name being in the the job_name column of Database A and AppName column of Database B. For example "App1"
I have no idea if / how it is possible to join 2 databases where as in this case the common application name not represented the same way in each database.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you Paul - this is outstanding. I will give it a try this weekend / monday.
Regards
Rich
Regards
Rich
ntgOne, do you still need help on this question?
SELECT ...
FROM DatabaseA.dbo.Table1 AS AT1
INNER JOIN DatabaseB.dbo.Table1 AS BT1
ON ...