Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi All,
I have created new Fabric SQL database. On this Fabric database I want to perform various operation on Fabric SQL database table like Insert/update/delete specifically from Fabric Notebook within same Workspace.
I tried DMP opertaion using Data pipeline which is working fine BUT we need these DMP opertation to be performed from existing Notebooks.
Kindly help how do I need to connect to Fabric SQL database from Fabric notebook and perform DML operation.
Thanks in advance
Solved! Go to Solution.
Hi @mail2atulm,
To perform INSERT, UPDATE, and Delete operations on your Fabric SQL database directly from a Fabric notebook within the same workspace. If your database is a Fabric Warehouse or a Mirrored SQL database with an analytics endpoint, the easiest way is to use the %%sql magic command in the notebook. You can simply write standard T-SQL commands like INSERT, UPDATE or Delete inside a %%sql cell, and it will execute directly against your database.
If you're using a Spark-based notebook or need more control, you can also connect to your Fabric SQL database using a JDBC connection within Python. This lets you write data from a DataFrame to your SQL table or execute more complex logic programmatically. You'll need your database connection details like the endpoint, database name, and credentials (or managed identity), and then you can use Spark’s write jdbc() function to perform your DML tasks. For more detailed guidance, you can refer to the official documentation on connecting to your SQL database in Microsoft Fabric: Connect to Your SQL Database - Microsoft Fabric.(Microsoft Learn)
Thanks,
Prashanth Are
MS Fabric community support
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and give Kudos if helped you resolve your query
Hi @mail2atulm,
To perform INSERT, UPDATE, and Delete operations on your Fabric SQL database directly from a Fabric notebook within the same workspace. If your database is a Fabric Warehouse or a Mirrored SQL database with an analytics endpoint, the easiest way is to use the %%sql magic command in the notebook. You can simply write standard T-SQL commands like INSERT, UPDATE or Delete inside a %%sql cell, and it will execute directly against your database.
If you're using a Spark-based notebook or need more control, you can also connect to your Fabric SQL database using a JDBC connection within Python. This lets you write data from a DataFrame to your SQL table or execute more complex logic programmatically. You'll need your database connection details like the endpoint, database name, and credentials (or managed identity), and then you can use Spark’s write jdbc() function to perform your DML tasks. For more detailed guidance, you can refer to the official documentation on connecting to your SQL database in Microsoft Fabric: Connect to Your SQL Database - Microsoft Fabric.(Microsoft Learn)
Thanks,
Prashanth Are
MS Fabric community support
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and give Kudos if helped you resolve your query
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Fabric update to learn about new features.
User | Count |
---|---|
14 | |
5 | |
4 | |
3 | |
2 |