USQL
I have multiple stored procedures defined in USQL database with the following signatures.
- MyDatabase.dbo.DoThing01(@ticketNumber int)
- MyDatabase.dbo.DoThing02(@ticketNumber int)
- MyDatabase.dbo.DoThing03(@ticketNumber int)
These stored procedures work when I call them from the azure analytics job UI in the portal manually.
I have data factory v2 pipeline setup, with an USQL activity that calls a script file located on azure datalake store which tries to pass a parameter value as @ticketNumber
What I have tried
Datafactory Activity
"typeProperties": {
"scriptPath": "Script.txt",
"degreeOfParallelism": 10,
"scriptLinkedService": {
"referenceName": "CampuslabsDatalakeStore",
"type": "LinkedServiceReference"
},
"parameters": {
"ticketNumber": "@item().InstitutionId"
}
}
Scenario 1 : USQL Script
DECLARE @ticketNumber int = -1;
MyDatabase.dbo.DoThing01(@ticketNumber);
MyDatabase.dbo.DoThing02(@ticketNumber);
MyDatabase.dbo.DoThing03(@ticketNumber);
ERROR : the script gets executed with default value of -1.
Scenario 2 : USQL Script
DECLARE @ticketNumber int;
MyDatabase.dbo.DoThing01(@ticketNumber);
MyDatabase.dbo.DoThing02(@ticketNumber);
MyDatabase.dbo.DoThing03(@ticketNumber);
ERROR : I get a compilation error that declaration of variable is wrong.
Scenario 3 : USQL Script
MyDatabase.dbo.DoThing01(@ticketNumber);
MyDatabase.dbo.DoThing02(@ticketNumber);
MyDatabase.dbo.DoThing03(@ticketNumber);
ERROR : I get a compilation error that variable is not defined.
My question is : How do you pass a dynamic value parameter to the USQL script from a v2 USQL activity