Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
100 | |
78 | |
75 | |
49 |
User | Count |
---|---|
145 | |
108 | |
107 | |
89 | |
61 |