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

60 Days of Data Days! Live and on-demand sessions, challenges, study groups and more! And it's all FREE!. Join now. Learn more

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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

June Fabric Update Carousel

Fabric Monthly Update - June 2026

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

Top Solution Authors
Top Kudoed Authors