Forum Discussion
How do I extract data from SQL through a query that unions multiple databases of SQL.
- 6 years ago
Hi Anonymous ,
You could write the T-SQL which could get data from mutiple databases under SQL Statement.
You can run the query in your Sql Server databsed firstly, if that works successfully, then you could copy it under SQL Statement in power bi desktop.
In addition, you could refer to the query below and modify it based on your scenario.
select * from [server].[database].[schema].[table] union select * from [server].[database2].[schema].[table] union select * from [server].[database3].[schema].[table]
Hope this can help you.
Best Regards,
Cherry
Hi Anonymous ,
You could write the T-SQL which could get data from mutiple databases under SQL Statement.
You can run the query in your Sql Server databsed firstly, if that works successfully, then you could copy it under SQL Statement in power bi desktop.
In addition, you could refer to the query below and modify it based on your scenario.
select * from [server].[database].[schema].[table] union select * from [server].[database2].[schema].[table] union select * from [server].[database3].[schema].[table]
Hope this can help you.
Best Regards,
Cherry