You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TSQLStatementReader.ParseStatements throws ArgumentOutOfRangeException exception when there is a string literal immediately after SELECT keyword like SELECT' '+item
Error Details:
ArgumentOutOfRangeException -> Non-negative number required. Parameter name: count
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.Collections.Generic.List`1.GetRange(Int32 index, Int32 count)
at TSQL.Expressions.Parsers.TSQLValueExpressionParser.ParseNext(ITSQLTokenizer tokenizer)
at TSQL.Expressions.Parsers.TSQLValueExpressionParser.Parse(ITSQLTokenizer tokenizer)
at TSQL.Expressions.Parsers.TSQLValueExpressionParser.ParseNext(ITSQLTokenizer tokenizer)
at TSQL.Expressions.Parsers.TSQLValueExpressionParser.Parse(ITSQLTokenizer tokenizer)
at TSQL.Expressions.Parsers.TSQLArgumentListParser.Parse(ITSQLTokenizer tokenizer)
at TSQL.Expressions.Parsers.TSQLValueExpressionParser.ParseNext(ITSQLTokenizer tokenizer)
at TSQL.Expressions.Parsers.TSQLSelectExpressionParser.Parse(ITSQLTokenizer tokenizer)
at TSQL.Elements.Parsers.TSQLSelectColumnParser.Parse(ITSQLTokenizer tokenizer)
at TSQL.Clauses.Parsers.TSQLSelectClauseParser.Parse(ITSQLTokenizer tokenizer)
at TSQL.Statements.Parsers.TSQLSelectStatementParser.Parse()
at TSQL.TSQLStatementReader.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Demo.ParseQuery(String query)
For example, the below lines of code (containing valid TSQL statement) throw this exception
string query = "SELECT STUFF((SELECT' '+item FROM pqr), 2, 3, 'ijklmn') FROM abc"; var statements = TSQLStatementReader.ParseStatements(query, useQuotedIdentifiers: true, includeWhitespace: false);
Please let me know what you think about this exception for valid TSQL statement.
Best regards
The text was updated successfully, but these errors were encountered:
Hello,
TSQLStatementReader.ParseStatements
throws ArgumentOutOfRangeException exception when there is a string literal immediately after SELECT keyword likeSELECT' '+item
Error Details:
ArgumentOutOfRangeException -> Non-negative number required. Parameter name: count
For example, the below lines of code (containing valid TSQL statement) throw this exception
string query = "SELECT STUFF((SELECT' '+item FROM pqr), 2, 3, 'ijklmn') FROM abc";
var statements = TSQLStatementReader.ParseStatements(query, useQuotedIdentifiers: true, includeWhitespace: false);
Please let me know what you think about this exception for valid TSQL statement.
Best regards
The text was updated successfully, but these errors were encountered: