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

Can't miss session! The 9 FabCon and SQLCon takeaways the community can't stop talking about. Join us on April 2nd. Register now

Reply
Sekelo77
Frequent Visitor

Connect Flask App to MSSQL database.

Hi,

Can you please assist with some advice or guidiance on how to connect my flask application, to our mssql server/database.

Could be a Youtube videos, or any online study material.

I have successfuly build my application and is working fine with sqlite, but my company uses MSSQL Server which is were I need to connect it to, I do have solid background on executing SQL statements, (T-SQL), but my request right is anyone with usefull guideline or information/walk through on how I connect the flask app to our inhouse db, would appreciate that.

 

Thank you

1 ACCEPTED SOLUTION
v-achippa
Community Support
Community Support

Hi @Sekelo77,

 

Thank you for reaching out to Microsoft Fabric Community.

 

Based on your requirement, since the application is already working with sqlite, you only need to update the database connection. The recommended approach is to use SqlAlchemy with the pyodbc driver, which works correctly with sql server in production environments. Please follow below steps:

  • Install pyodbc and ensure the ODBC Driver for sql server is installed
  • Update your connection string to use mssql+pyodbc
  • Your existing models and queries can remain the same

You can also execute raw T-Sql queries if needed using SqlAlchemy.

 

Thanks and regards,

Anjan Kumar Chippa

 

 

View solution in original post

2 REPLIES 2
v-achippa
Community Support
Community Support

Hi @Sekelo77,

 

Thank you for reaching out to Microsoft Fabric Community.

 

Based on your requirement, since the application is already working with sqlite, you only need to update the database connection. The recommended approach is to use SqlAlchemy with the pyodbc driver, which works correctly with sql server in production environments. Please follow below steps:

  • Install pyodbc and ensure the ODBC Driver for sql server is installed
  • Update your connection string to use mssql+pyodbc
  • Your existing models and queries can remain the same

You can also execute raw T-Sql queries if needed using SqlAlchemy.

 

Thanks and regards,

Anjan Kumar Chippa

 

 

Thank You.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Fabric Update Carousel

Fabric Monthly Update - March 2026

Check out the March 2026 Fabric update to learn about new features.

Top Solution Authors
Top Kudoed Authors