Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredJoin us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered
Hi,
I am trying to merge data into a table in a Fabric warehouse.
Since MERGE is not supported yet, I am performing the merge in two steps: Update exising entries and Insert new entries (for this specific table, no delete is required).
We'll only have look at the update part, since this already causes the error by itself:
When i run this (simplified version) as a regular SQL-Statement, it works:
UPDATE DWH.Customer
SET Name= SRC.Name
FROM DWH.Customer DST
INNER JOIN Stage.Customer SRC
ON DST.Company = SRC.Company
AND DST.Code = SRC.Code;
This completes in about 5 seconds.
When I wrap the whole thing in a stored procedure, it runs for a while and then fails with:
"Maximum stored procedure, function, trigger, or view nesting level exceeded (limit 32)."
Interstingly, the update works correctly, but the process keeps running for an additional 10 seconds before it fails.
Any ideas what causes this and how to fix it? I ran into something similar years ago in a customer project where they were using an ungodly logic based on hundereds of triggers. Then, the error made sense. But joining two tables should not cause this.
UPDATE:
I have an update on this. I tried the same approach for a different table (which has more columns and rows and addtional field on which I perform the join) and it works. Does this have something to do with the underlying delta structure (e.g. Fabric performing additional joins under the hood, over which I have little control)?
Solved! Go to Solution.
Hi, I tried you suggestions - to no avail unfortunately.
I ended up deleting the SP and re-creating it by deploying a bacpac from VS Code. This seems to have done the trick.
Thank you!
Hi @sgeheeb ,
Thanks for reaching out to the Microsoft fabric community forum.
Currently there are no known issues related to stored procedure in Fabric Warehouse which may cause the error.
I also tried to replicate your exact scenario and I have not faced the same error, perhaps it may be helpful to check if there are any mistakes with syntax other than that,
Check whether there are any triggers defined on the DWH.Customer table, as unintended recursion can occur from system generated or user defined triggers. You can inspect this by running the query:
SELECT *
FROM sys.triggers
WHERE parent_id = OBJECT_ID('DWH.Customer');
If any triggers are returned, review their logic carefully, and consider disabling them temporarily to determine whether they are contributing to the nesting level issue.
Additionally try creating a stored procedure with some other update query to check if the issue is specific to the merge query or related update query in general.
Please try these troubleshooting steps to find any particular root cause of the issue.
If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thank you
Hi, I tried you suggestions - to no avail unfortunately.
I ended up deleting the SP and re-creating it by deploying a bacpac from VS Code. This seems to have done the trick.
Thank you!
Hi @sgeheeb ,
We really appreciate your efforts and for letting us know the update on the issue.
Please accept your reply as the solution so as to help other community members who may come across this post in the future.
Please continue using fabric community forum for your further assistance.
Thank you