I have a Stored Procedure activity in my Azure Data Factory pipeline that recalls the following stored procedure on Azure Synapse:
CREATE PROCEDURE schema.procedure_name @portafoglio INT [...]
The activity in configured in order to use a variable (portafoglioElab), previously set in the pipeline:
My problem is how to pass a Null value as input parameter to the procedure via the Azure Data Factory Pipeline in the Store Procedure activity.
I’ve tried by setting the variable portafoglioElab with null, "null", None, @coalesce(null) but I’m not finding the right value corresponding to sql NULL.
This is the step of the pipeline where I set the variable:
It is a step inside the IF condition of the whole pipeline:
Indeed I’m getting this error:
Cannot create Sql Source. Please double check the connection string, stored procedure are set with correct format. Error: The value of the property ‘Value’ is invalid for the stored procedure parameter ‘portafoglio’.
Can please someone help me?
Thanks in advance
2
Answers
I've found a solutions with the dynamic content.
It is not only possible to put dynamic content in the value of the parameter, but even the parameter itself cam be dynamic.
I solved after many tests with this value:
In this way I can handle null and not null values. Pay attention that the documentation is wrong, the content has to be a dictionary, not a string.
Pass -1 or some other sentinel and handle it in the proc