microsoft / SqlScriptDOM

ScriptDOM/SqlDOM is a .NET library for parsing T-SQL statements and interacting with its abstract syntax tree

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GO [count] not parsed

ghost opened this issue · 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

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

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