Forum Discussion
UnsupportedArtifactException SQLDatabase in Python notebook tsql cell
- 1 year ago
Hi sharp1FL , Thank you for reaching out to the Microsoft Community Forum.
Microsoft Fabric notebooks do not support connecting to SQLDatabase artifacts using the %tsql magic command. %tsql in Fabric notebooks currently only supports querying data from Lakehouse and Warehouse artifacts. Attempting to use any other artifact type will result in this exact exception.
Ensure your orchestration data is available in a supported artifact like a Warehouse or Lakehouse, then modify your code as follows:
%%tsql -artifact MyWarehouse -bind df2
SELECT * FROM dbo.my_table
Author and run T-SQL notebooks in Microsoft Fabric - Microsoft Fabric | Microsoft Learn
Run T-SQL code in Fabric Python notebooks - Microsoft Fabric | Microsoft Learn
I dug a little more, and it appears that the documentation beat the availability of this feature for SQL databases.
From sukkaur "Team is working on this capability and this should be coming available for customers use by next month."
How to connect to Fabric database from fabric note... - Microsoft Fabric Community
Hi sharp1FL , Thank you for reaching out to the Microsoft Community Forum.
Yes, using a Warehouse for orchestration tables works, but it’s not a perfect substitute for a SQL database. Fabric Warehouses are optimized for analytical queries, not transactional operations. Frequent INSERT/UPDATE/DELETEs can be slower and less efficient than in a SQL database and transactional guarantees (like row-level locking) are limited.
For light or batched orchestration logic (e.g., logging or status updates), it’s a workable short-term solution. But for high-frequency or dependency-sensitive writes, you may hit performance limits. Once SQL database support in notebooks is live, it’ll be the better fit.
Limitations of Fabric Data Warehouse - Microsoft Fabric | Microsoft Learn