We have encountered a parsing issue in Microsoft Documentation in JSON_OBJECTAGG using TSql170Parser 170.128.0.
Example script
SELECT JSON_OBJECTAGG( t.c1 : t.c2 )
FROM (
VALUES('key1', 'c'), ('key2', 'b'), ('key3','a')
) AS t(c1, c2);
Steps to reproduce
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 ':'