Version - 180.78.1
Parser - TSql180Parser and TSql170Parser
Issue Description : When the fragment for the parameter in CAST function is calculated it consist only the "'Test'" part and does not contain the "AS VARCHAR(20)" section.
Steps to reproduce -
Try parsing the below SQL script with the parser:
SELECT CAST('TEST' AS VARCHAR(20))
Example -
using Microsoft.SqlServer.TransactSql.ScriptDom;
internal class Program
{
static void Main(string[] args)
{
var script = "Example Script";
var parser = new TSql180Parser(true);
var fragment = parser.Parse(new StringReader(script), out var parseErrors);
if (parseErrors.Count > 0)
{
foreach(var parseError in parseErrors)
Console.WriteLine(parseError.Message);
}
else
{
Console.WriteLine("Parsed successfully");
}
}
}
Actual Output - Parameter fragment given by the parser - 'TEST'
Expected Output - Parameter fragment - 'TEST' AS VARCHAR(20)
Version -
180.78.1Parser - TSql180Parser and TSql170Parser
Issue Description : When the fragment for the parameter in CAST function is calculated it consist only the "'Test'" part and does not contain the "AS VARCHAR(20)" section.
Steps to reproduce -
Try parsing the below SQL script with the parser:
Example -
Actual Output - Parameter fragment given by the parser - 'TEST'
Expected Output - Parameter fragment - 'TEST' AS VARCHAR(20)