Named parameters emulation
Synapse Analytics supports calling stored procedures using named parameters, allowing arguments to be passed in any order by explicitly specifying parameter names. This improves code readability and flexibility.
However, Microsoft Fabric Warehouse does not support named parameters — it requires procedure calls to use strictly positional arguments that match the declared parameter order exactly.
To bridge this gap, SQL Tran automatically rewrites procedure calls: it analyzes the procedure signatures and transforms named arguments into the correct positional order. If any optional parameters are omitted, SQL Tran inserts NULL
placeholders to preserve alignment.
This ensures that procedures originally relying on named parameters will continue to function correctly after migration, eliminating the need for manual adjustments.
(For more information, see the following emulation reference page: Named procedure parameters)
Code example
Synapse Analytics:
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;
Training video example
In the example shown, a procedure contains a call to another procedure using named parameters — a feature supported in Synapse but not in Fabric.
SQL Tran automatically transforms this call by replacing the named parameters with correctly ordered positional arguments in the target SQL.
If a parameter is removed from the procedure call in the source SQL (such as omitting the middle argument), SQL Tran maintains positional integrity by inserting a NULL
in its place in the target SQL.
This ensures that argument positions remain aligned with the procedure’s expected signature, preserving the intended behavior in Fabric’s stricter environment.

Last updated