Error formatting SQL: Error: Unhandled exception: System.Exception: Incorrect syntax

I have just updated SQL Prompt to version 0.2.15. The formatting worked fine for a few days, but now I get this error:

Error formatting SQL: Error: Unhandled exception: System.Exception: Incorrect syntax near             ON. at RedGate.SqlPrompt.Format.Engine.AzureDataStudio.CommandLine.Commands.FormatSqlOptions.FormatSql(String sql, String styleName, LayoutOptions style) in D:\BuildAgentA\work\dc5fefc0dc183d00\Engine\Format.Engine\AzureDataStudio\CommandLine\Commands\FormatSqlCommand.cs:line 61 at RedGate.SqlPrompt.Format.Engine.AzureDataStudio.CommandLine.Commands.FormatSqlOptions.OnValidAuthToken(String adsStylesPath, String styleName, Boolean applyCasing) in D:\BuildAgentA\work\dc5fefc0dc183d00\Engine\Format.Engine\AzureDataStudio\CommandLine\Commands\FormatSqlCommand.cs:line 44 at RedGate.SqlPrompt.Format.Engine.AzureDataStudio.CommandLine.AuthToken.RunIfValid(String authToken, Action callback) in D:\BuildAgentA\work\dc5fefc0dc183d00\Engine\Format.Engine\AzureDataStudio\CommandLine\AuthToken.cs:line 16 at System.CommandLine.Handler.<>c__DisplayClass5_0`4.b__0(InvocationContext context) at System.CommandLine.Invocation.AnonymousCommandHandler.Invoke(InvocationContext context) at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass19_0.<b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b__18_0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b__5_0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass8_0.<b__0>d.MoveNext() Please ensure you highlighted a valid block of T-SQL.

Is anyone else experiencing this problem? @Robyn you helped with the last similar problem we had- is this related?

Thanks 

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file