2

I want to use my SQL script (present under Develop hub) file inside a Pipeline (present under Integrate hub). Currently I do not see any Activities available solving this purpose.

There is one Script activity under General section which only have a Query & NonQuery option, not for referring any SQL script file created earlier.

Is that feature available at all in Azure Synapse Analytics? Can we refer to SQL script by some other means?

Gourav Dutta
  • 533
  • 4
  • 10
  • you can copy/paste your script into the task. Do you have any reason for wanting to keep it external? An ever better approach is to create your script as a stored procedure inside the database so your source code is kept with your data – Nick.Mc Jul 25 '22 at 13:25

1 Answers1

0

If your Synapse workspace is paired with Azure DevOps then I imagine it’s easy to get the file content with a REST API call (eg here). However then you have to parse the file as GO is not supported by the Script activity. ADF / Synapse Pipeline functions do not support a RegEx style split eg word boundary and GO (\bGO\b) so it starts to get kind of fiddly. I had some success with replace and uriComponent functions.

However you would be better of using Stored Procedures and the Stored Proc activity in Synapse Pipelines - much simpler implementation.

wBob
  • 13,710
  • 3
  • 20
  • 37