What are the challenges you face when working across database platforms? Take the survey
Options

7.3.0.568 - Formatting += fails

henrik_ffchenrik_ffc Posts: 9 Bronze 1
edited October 1, 2016 3:24PM in SQL Prompt
The following SQL fails to be formatted using default style:

DECLARE @txt NVARCHAR(MAX) = '';
SELECT @txt += '';

The Error dialog tells me:
Error laying out sql.
SQL PRompt was unable to complete this operation.
Problems areas have been highlighted.

The log file contains the following error:

WARN RedGate.SqlPrompt.ScriptDomInterop.FormatterV2 - Error at range (0:1): System.ArgumentNullException: Value cannot be null.
Parameter name: token
at ..(TSqlFragment , TSqlParserToken , Boolean )
at ..(SelectSetVariable )
at ..(SelectSetVariable )
at Microsoft.SqlServer.TransactSql.ScriptDom.TSqlFragmentVisitor.ExplicitVisit(SelectSetVariable node)
at Microsoft.SqlServer.TransactSql.ScriptDom.SelectSetVariable.Accept(TSqlFragmentVisitor visitor)
at Microsoft.SqlServer.TransactSql.ScriptDom.QuerySpecification.AcceptChildren(TSqlFragmentVisitor visitor)
at Microsoft.SqlServer.TransactSql.ScriptDom.TSqlFragmentVisitor.ExplicitVisit(QuerySpecification node)
at Microsoft.SqlServer.TransactSql.ScriptDom.QuerySpecification.Accept(TSqlFragmentVisitor visitor)
at Microsoft.SqlServer.TransactSql.ScriptDom.SelectStatement.AcceptChildren(TSqlFragmentVisitor visitor)
at Microsoft.SqlServer.TransactSql.ScriptDom.TSqlFragmentVisitor.ExplicitVisit(SelectStatement node)
at Microsoft.SqlServer.TransactSql.ScriptDom.SelectStatement.Accept(TSqlFragmentVisitor visitor)
at Microsoft.SqlServer.TransactSql.ScriptDom.TSqlBatch.AcceptChildren(TSqlFragmentVisitor visitor)
at Microsoft.SqlServer.TransactSql.ScriptDom.TSqlFragmentVisitor.ExplicitVisit(TSqlBatch node)
at Microsoft.SqlServer.TransactSql.ScriptDom.TSqlBatch.Accept(TSqlFragmentVisitor visitor)
at Microsoft.SqlServer.TransactSql.ScriptDom.TSqlScript.AcceptChildren(TSqlFragmentVisitor visitor)
at Microsoft.SqlServer.TransactSql.ScriptDom.TSqlFragmentVisitor.ExplicitVisit(TSqlScript node)
at Microsoft.SqlServer.TransactSql.ScriptDom.TSqlScript.Accept(TSqlFragmentVisitor visitor)
at Format.Engine.Formatting.SqlFormatter.Format(String script, IScriptWriter scriptWriter, CancellationToken cancellationToken, IList`1& parseErrors)
at RedGate.SqlPrompt.ScriptDomInterop.Format.FormatterV2.FormatScript(String script, LayoutOptions activeStyle, IList`1& formatErrors)
at RedGate.SqlPrompt.ScriptDomInterop.Format.FormatterV2.FormatScript(String script, String activeStyleName, ITextWriterInterop textWriter, Int32 startIndex)
// Henrik

Comments

Sign In or Register to comment.