Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello all,
I have written a SQL query which I want to extract on powerBI. The query includes UNION of multiple databases..
What I tried = " go to GET DATA - Server - AdvanceOptions and inserted my query and click OK."
It is asking me to give the database name. But query includes multiple databases.
How do I extract data from SQL through a query that unions multiple databases of SQL.
Solved! Go to Solution.
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 ,
Have you solved the problem?
If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.
If you still need help, free to ask.
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
User | Count |
---|---|
126 | |
108 | |
99 | |
65 | |
62 |
User | Count |
---|---|
137 | |
116 | |
102 | |
71 | |
61 |