-
Notifications
You must be signed in to change notification settings - Fork 33
Closed
Labels
fixed-pending-releaseFix in upcoming releaseFix in upcoming release
Description
Version - 170.100.0
Parser - TSql170Parser
When order by clause
is used inside JSON_ARRAYAGG
it does not get parsed with above mentioned parser version and details.
Steps to reproduce -
Try parsing the below SQL script with the parser:
SELECT TOP(5) c.object_id, JSON_ARRAYAGG(c.name ORDER BY c.column_id) AS column_list
FROM sys.columns AS c
GROUP BY c.object_id;
Note : Example used is available on Microsoft documentation here
Example -
static void Main(string[] args)
{
var script = "<Example Script>";
var parser = new TSql170Parser(true, 0);
var fragment = parser.Parse(new StringReader(script), out var parseErrors);
if (parseErrors.Count > 0)
{
Console.WriteLine(parseErrors[0].Message);
}
}
Error message :-
Incorrect syntax near 'ORDER'.
Metadata
Metadata
Assignees
Labels
fixed-pending-releaseFix in upcoming releaseFix in upcoming release