SQL Tran Docs
  • Overview
    • About
    • Getting started
    • Object lifecycle
    • Why is there no AI inside?
    • Performance considerations
    • Security considerations
    • Assessment
    • Unlocking projects
    • Interface walk-through
    • Translation scenarios
    • Prerequisites for Azure Marketplace deployment
  • Emulation Scenarios
    • Emulation in SQL Tran
    • SQL Server to Fabric Warehouse
      • Data types
      • Case sensitivity
      • Cursors
        • Basic cursor loop
        • Cursor types
        • Fetch direction modes
        • Cursors in control flow
        • Nested cursors
        • Data modification cursors
        • Multiple cursors
        • Subqueries and filtering
      • Named procedure parameters
      • Result set limiting
      • MERGE statements
      • Computed columns
      • External tables
      • Identity columns
      • Default values
      • Sequences
      • Unsupported system objects
    • Synapse Analytics to Fabric Warehouse
      • Emulations
      • Limitations
    • SQL Server to Synapse Analytics
    • Oracle to PostgreSQL
  • Project wizard
    • Source database
    • Target database
    • Wrapping up
  • Projects
    • Project list
    • Overview
    • Workspace
    • Reports
    • Tests
    • Scratch pad
    • Settings
      • Project name
      • Mapping
      • Database connections
    • Navigation
    • Object complexity
    • Static analysis
    • Translation errors
    • Exporting and importing projects
  • Workspace
    • Object tree
    • Data lineage
    • Code
    • Actions
      • Overriding source
      • Overriding target
      • Ignoring objects
  • Tests
    • Workflow
    • Configure SQL Tran
    • Connecting to databases
      • Fabric Warehouse
      • Synapse Dedicated SQL Pool
      • Azure SQL Database, Azure SQL Managed Instance, Microsoft SQL Server
    • Tables
    • Views
    • Procedures
    • Functions
    • Triggers
    • Performance tests
  • Scripter
    • About
    • Supported databases
    • SQL Server
    • Azure SQL
    • Synapse Dedicated Pool
    • Oracle
    • PostgreSQL
    • MySQL
Powered by GitBook
On this page
  • Emulation context
  • Emulation strategy
  • Code example
  • Important notes
  1. Emulation Scenarios
  2. SQL Server to Fabric Warehouse

Named procedure parameters

Emulation context

In SQL Server, stored procedures can be invoked using named parameters, for example:

EXEC dbo.MyProc @Param1 = 42, @Param2 = 'abc'

This improves readability, allows reordering of arguments, and reduces the risk of positional mismatches.

However, Microsoft Fabric Warehouse does not support named parameters in procedure calls. Instead, it requires strictly positional arguments, for example:

EXEC dbo.MyProc 42, 'abc'

This difference creates an important compatibility gap:

  • SQL Server procedures can rely on the caller using named arguments, allowing the definition and call order to differ.

  • Fabric Warehouse mandates that procedure calls match the exact declared parameter order.

This mismatch affects any migrated scripts, applications, or orchestration tools that depend on the flexibility of named parameters.


Emulation strategy

SQL Tran addresses this by transforming named EXEC calls into positional EXEC calls by:

  • Analyzing the stored procedure signature to determine the declared parameter order.

  • Rewriting any named parameter calls into positional calls, placing each argument in the correct slot. Even if the original SQL call provided parameters out of order using names, the translated Fabric call aligns the arguments correctly by position.

  • Inserting explicit NULL for any omitted optional parameters to maintain positional integrity.

  • Adding SET statements using ISNULL inside the target procedure body to apply declared default values at runtime.

  • Including /* SQLTRAN FIX */ comments alongside the transformed calls to show the original named expressions for traceability.

This automatic transformation enables most standard EXEC calls to continue functioning correctly in Fabric Warehouse without manual rewrites.


Code example

SQL Server:

CREATE PROCEDURE dbo.ExampleProcedure
    @PersonID INT,
    @FirstName NVARCHAR(50),
    @Height DECIMAL(5,2) = 0.0,
    @Age INT = NULL
AS
BEGIN
    RETURN;
END
GO

CREATE PROCEDURE dbo.TestNamedParameters
AS
BEGIN
    -- Call with reordered parameters
    EXEC dbo.ExampleProcedure
        @Age = 30,
        @FirstName = 'John',        
        @PersonID = 12345
END;

Fabric Warehouse (generated by SQL Tran):

CREATE PROCEDURE dbo.ExampleProcedure
    @PersonID INT,
    @FirstName NVARCHAR(50),
    @Height DECIMAL(5,2)/* SQLTRAN FIX:  = 0.0 */,
    @Age INT/* SQLTRAN FIX:  = NULL */
AS
BEGIN
    SET @Height = ISNULL(@Height, 0.0);
    SET @Age = ISNULL(@Age, NULL);
    /* SQLTRAN FIX: RETURN; */
END
GO
CREATE PROCEDURE dbo.TestNamedParameters
AS
BEGIN
    -- Call with reordered parameters
    EXEC dbo.ExampleProcedure 12345,
	'John',
	NULL,
	30; /* SQLTRAN FIX: EXEC dbo.ExampleProcedure
        @Age = 30,
        @FirstName = 'John',        
        @PersonID = 12345 */
END;

Important notes

  • Procedure signature dependency: The translation relies on having access to the procedure definition to resolve parameter order. Missing or outdated metadata can result in incorrect rewrites.

  • Explicit NULL handling: When an optional parameter is omitted, SQL Tran inserts NULL into the positional call, even if the procedure defines another default. The translated procedure applies the declared defaults using SET and ISNULL.

  • Dynamic EXEC exclusion: Dynamically constructed EXEC statements (via strings, variables, or sp_executesql) are not transformed by SQL Tran and require manual handling.

  • Manual validation recommended: For dynamic, indirect, or complex procedures, human review is essential to ensure that the translation aligns with the intended semantics and preserves default behaviors.

PreviousSubqueries and filteringNextResult set limiting

Last updated 5 days ago

Named procedure parameters emulation in SQL Tran