I have two different tables in two different databases. Need to join both the table and get results using query
1) reports - report_id, report_name, description
table reports is present in database 'A'
2) report_owners - report_id, report_owner
table report_owners is present in database 'B'
tried following query for joining the tables but it's throwing error ( Reference to server and/ database is not supported in this version of SQL server).
Query:
select * from [A].[dbo].['reports'] as all_reports
INNER JOIN
select * from [B].[dbo].['report_owners'] as all_owner
ON all_report.report_id = all_owners.report_id
Note: from Database 'A' have access for cross query functionality for database 'B'
Anyone please help me to solve this issue?