Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

Erro do OLE DB ou do ODBC : [DataSource.Error] Microsoft SQL

Hi All , I'm facing a data refresh error after update my PBI Desktop, now its showing the erros below in two tables that I have (in the old version this issue doesnt occu.  When I edit the queries the errors are not showed and it seems to be some record in the database that can be causing the error.

 

Does anybody know how can I debug this or know how to fix it?

 

"Erro do OLE DB ou do ODBC : Exceção de HRESULT: 0x80040E4E"

"Erro do OLE DB ou do ODBC : [DataSource.Error] Microsoft SQL: Incorrect syntax near the keyword 'union'"
10 REPLIES 10
mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Anonymous ,

 

do you use pure Power Query or SQL queries?

UNION indicates that a query is being appended. Do you have a corresponding query?

You can use tools such as the SQL Profiler to trace the query on the database.

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Anonymous
Not applicable

Hi @mwegener , I've noticed that the querie that is showing problem is a combined querie, it always show error when it reaches line 4096 in the update process.  During the process, when it reachs linhe 4096 it restart the counting and the error is showed.  Any tips?

luyper_0-1600451515375.png

 

Hi @Anonymous ,

 

This seems to be an error in the SQL query in the database. You can check the data source in the database.

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi @v-lionel-msft , the querie works for the first 1000 lines, I believe that this querie is constructed by the joined querie PBI resource, and the original tables that compose this joined table doesnt show the error, neither when a set the profile to show all data.

 

best regards;

mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Anonymous ,

 

Try the following steps for more information.

Expand the Column Profile in the lower left corner of Power Query.

2020-09-18 23_32_41-Window.png

 

See if you can get the native query from the query.

2020-09-18 23_33_34-Window.png

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Anonymous
Not applicable

Hi @mwegener , I've noticed that this joined querie shows the error below in all collums when I set profile to show all data and a red line is also displayed, when the profile is set to first 1000 lines the error is not showed.

 

luyper_2-1600960772970.png

luyper_1-1600960749027.png

I got the native querie but it is too long to past here, but I don't believe that is a querie problem because it works for the first 1000 lines and worked in previes release of PBI Desktop that I was using before update to the last release.  Coud it be a problem in this release with the resource below that was used to join two tables?

luyper_4-1600961583564.png

Thanks a lot.

 

 

 

mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Anonymous ,

 

have you tried the Power BI Desktop September release?

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Anonymous
Not applicable

@mwegener , I was using August Release, but I updated to september and the same issue is happening.

 

thanks.

mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Anonymous ,

 

i think you need to try to get more information about the error.

In the Youtube video "Get more info with Power Query tracing in Power BI Desktop" Adam Saxton shows how he deals with such a problem.

https://www.youtube.com/watch?v=4QJdCI6xmaA

 

Alternatively, you can open a support ticket with your Power BI Pro license.

https://powerbi.microsoft.com/en-us/support/

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


I had a similar error, and managed to fix it, deleting the duplicate lines.
For some reason when you have a column with duplicate values ​​the error occurred.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.