SqlScriptDOM icon indicating copy to clipboard operation
SqlScriptDOM copied to clipboard

GO [count] not parsed

Open ghost opened this issue 2 years ago • 2 comments

  • DacFx Version: Nuget latest (160.6161.0)
  • .NET: 6.0.301
  • Environment (local platform and source/target platforms): linux-x64

Steps to Reproduce:

  1. parse T-SQL script with GO [count] statement
  2. parsing fails on [count]

GO: https://docs.microsoft.com/en-us/sql/t-sql/language-elements/sql-server-utilities-statements-go?view=sql-server-ver15

sample parsing code: https://gist.github.com/josef-marec/1a56d2d04418fd749d0285aaaf440253

sample T-SQL:

` select current_timestamp

GO 2 `

Did this occur in prior versions? If not - which version(s) did it work in?

yes

ghost avatar Jun 29 '22 11:06 ghost

This is expected behavior - as the page you linked mentions GO isn’t valid tsql, it’s specific to a few environments.

dzsquared avatar Jun 30 '22 03:06 dzsquared

you mean, that i should expect this to be parsed:

select current_timestamp GO

while this not:

select current_timestamp GO 2

i know where GO is valid, i wonder why Microsoft.SqlServer.TransactSql.ScriptDom supports GO only without its conditional parameter

ghost avatar Jun 30 '22 09:06 ghost