You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Block comments immediately before a batch separator prevent the separator being detected #196
If I try executing it through SMO, it is treated as one batch and is sent unchanged, with the GO in the middle causing an error. It doesn't seem to matter if there is any whitespace between the end of the comment and the GO, nor does the block comment being spread across multiple lines have any effect.
This behaviour is in packages up to 172.64.0 (the latest at time of writing), from at least as far back as 160.2004021.0. I would have gone further back but I couldn't easily find the standalone SMO DLLs.
changed the title [-]Multiline comments immediately before a batch separator prevent the separator being detected[/-][+]Block comments immediately before a batch separator prevent the separator being detected[/+]on May 11, 2025
Any support for batches in SMO has always been minimal. The existence of Database.ExecuteNonQuery is purely to support the modest batching needs of other SMO components, not broad use by third party applications. It's why the BatchParser SMO uses is internal now - it's not nearly as full featured as the SSMS and SqlCmd batch parsers.
Activity
[-]Multiline comments immediately before a batch separator prevent the separator being detected[/-][+]Block comments immediately before a batch separator prevent the separator being detected[/+]shueybubbles commentedon May 12, 2025
Any support for batches in SMO has always been minimal. The existence of
Database.ExecuteNonQueryis purely to support the modest batching needs of other SMO components, not broad use by third party applications. It's why the BatchParser SMO uses is internal now - it's not nearly as full featured as the SSMS and SqlCmd batch parsers.