Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 months ago
Solved

Stored Procedure to Manipulate Tables

I am migrating stored procedures from SSIS into a Fabric Warehouse stored procedure. When I try to run it from a script or stored procedure activity in a pipeline I get the error "queries referencing...
  • v-sgandrathi's avatar
    3 months ago

    Hi Anonymous,

     

    Yes, this is currently a limitation of the Fabric Warehouse engine, not an issue with your implementation.

    Fabric Warehouse does not fully support variable-based predicates in distributed DML operations like DELETE, UPDATE, or certain INSERT  SELECT patterns, which causes the error regardless of whether the procedure is triggered from a Stored Procedure activity, Script activity, or Lookup activity.

    For large migrated SSIS procedures, rewriting every statement into dynamic SQL is challenging and can be hard to maintain. Common workarounds include:

    • Using dynamic SQL for the affected DML sections
    • Moving complex logic into a Notebook/Spark flow
    • Refactoring logic into set-based operations to avoid variable references in distributed execution

    Your expectation is valid, this is a product limitation rather than a design issue. Microsoft is working to improve Fabric Warehouse, so this may change as more SSIS/T-SQL migration scenarios are supported.

    You might also consider raising or upvoting this in the Fabric Ideas forum, as procedural T-SQL parity is a frequent migration need.


    Here are the MS Docs for your reference:

    Performance Guidelines - Microsoft Fabric | Microsoft Learn
    CREATE TABLE AS SELECT (Microsoft Fabric and Azure Synapse Analytics) - SQL Server | Microsoft Learn
    Serverless SQL pool self-help - Azure Synapse Analytics | Microsoft Learn

    Thank you.