Can you please help me will FOR XML PATH works in Azure Synapse. If not what will be the alternative.
Thanks
Can you please help me will FOR XML PATH works in Azure Synapse. If not what will be the alternative.
Thanks
In case you you're looking to use FOR XML to prepare e.g. column names for a dynamic pivot query, then the string_agg function is what you are looking for.
Azure Synapse Analytics dedicated SQL pools (and serverless SQL pools) do not support the FOR XML
syntax as per the documentation:
The easiest thing to do would be use Azure SQL DB to do your XML processing, eg use a pipeline to land your data there, call a Stored Proc activity to do the processing then retrieve it. Another fun alternative would be to use a Synapse notebook and use Python or Scala to process the XML.