Hi,
We need some technical guidance from either a Azure Synapse specialist to resolve an issue which we are unable to understand / fix despite running through the sql logic bit-by-bit, line-by-line. Any guidance or help would be much appreciated.
We have a stored procedure in Azure Synapse Analytics which is erroring with a "Message Type Not Found" when the last select command goes past 1645 lines in the coding. The script has a last select command and lists out a set of fields to pull back the data.
The error message appears within the last select command just 6 fields / lines of code short of the end of the stored procedure. The stored procedure when run by a pipeline in Azure Synapse creates a table with the last 6 fields returning nulls.
On working through the script there are some interesting points:
1 - When spaces and comments are removed and the stored procedure header are all removed, then more fields can be added to the last select command without the error messaging appearing. Ie we can run the script with all the fields included in the last select command apart from the last field before the error message appears. It seems to suggest the error is related to the length of scripting.
2 - The error is not related to the specific fields being called as if you remove a field from higher up in the last select command then add the last field at the end, then the script will work without the error.
3 - The same script runs without any issues in Microsoft SQL Server Management Studio
4 - We are running the stored procedure and script on Azure Synapse Analytics with a serverless solution and so although i have read Microsoft Azure articles about resource classes and restrictions, this should not apply when using a serverless solution.
5 - We are running the scripting within the Azure Synapse Analytics web portal and running this via stored procedures and pipelines. We are also running the script by just highlighting and running the select commands listed within the stored procedure and still the error message is appearing.
6 - When using select * command pointing to the last cte / temp table and removing the line-by-line last select command which lists out every temp table field, then the script works without the error. This reduces the number of lines used in the last select command.
Any technical guidance to help us understand / resolve our issue would be much appreciated.
Many thanks.
Mike King