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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
Anonymous
Not applicable

odbcs vs connect to sql

Hi

im wokring on pbix which is already using odbc. its slow.. can i change it to connect directly to SQL server?

 

what are common senarios which odbc is only option or prefered to use odbc? 

 

 

1 ACCEPTED SOLUTION
v-deddai1-msft
Community Support
Community Support

Hi @Anonymous ,

 

You can follow the following steps:

 

Copy your PBIX file to a new file .Then, create a new query that connects via SQL. Then, open the Advanced Editor and copy the Source line only.

 

Capture1.PNG

 

Open your ODBC query and replace the Source line with the one that you copied:

 

Capture2.PNG

 

And after you apply it, you need to change the credential for it.

 

Each of those classes does the same thing but is optimised for different databases. The SqlConnection deals directly with SQL Server, the ODBC Connection requires an ODBC provider for the database to which you want to connect, SqlConnection is more efficient when using SQL Server because there is no ODBC provider in between and you can make use of all possible SQL Server-specific optimisations. For more details, please refer to http://www.differencebetween.net/technology/software-technology/difference-between-odbc-and-sql-2/#ixzz6D5EuzKbL

 

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

 

Best Regards,

Dedmon Dai

 

 

 

 

View solution in original post

2 REPLIES 2
v-deddai1-msft
Community Support
Community Support

Hi @Anonymous ,

 

You can follow the following steps:

 

Copy your PBIX file to a new file .Then, create a new query that connects via SQL. Then, open the Advanced Editor and copy the Source line only.

 

Capture1.PNG

 

Open your ODBC query and replace the Source line with the one that you copied:

 

Capture2.PNG

 

And after you apply it, you need to change the credential for it.

 

Each of those classes does the same thing but is optimised for different databases. The SqlConnection deals directly with SQL Server, the ODBC Connection requires an ODBC provider for the database to which you want to connect, SqlConnection is more efficient when using SQL Server because there is no ODBC provider in between and you can make use of all possible SQL Server-specific optimisations. For more details, please refer to http://www.differencebetween.net/technology/software-technology/difference-between-odbc-and-sql-2/#ixzz6D5EuzKbL

 

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

 

Best Regards,

Dedmon Dai

 

 

 

 

amitchandak
Super User
Super User

@Anonymous , ODBC should be used only when direct connector is not available.

How to change connection details - https://youtu.be/59PUFuuCrbY - here you to change complete connection string

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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