How can we help you today? How can we help you today?

7.3.0.568 - Formatting += fails

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_ffc
0

Comments

3 comments

  • David Priddle
    Hi henrik_ffc,

    Thanks for letting us know about this! We have managed to reproduce it and will include the fix in the next release.

    Best regards,

    David
    David Priddle
    0
  • David Priddle
    Hi henrik_ffc,

    We've put in a fix for this in the latest update, which you can download through Check for updates or from the announcement post.

    Could you let us know if it solves your problem?

    Best regards,

    David
    David Priddle
    0
  • henrik_ffc
    Did not work in 7.3.0.583, but DID work in 7.3.0.585.

    Thanks!

    // Henrik
    henrik_ffc
    0

Add comment

Please sign in to leave a comment.