SqlQuantumLeap / SimpleSqlExec

Lightweight command-line utility to execute queries on SQL Server in place of SQLCMD

Home Page:https://SqlQuantumLeap.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handle block comments before a GO

SqlQuantumLeap opened this issue · comments

Batch parsing should be able to handle the following cases:

  1. single, single-line block comment:

    /* comment */  GO
    
  2. single, multiple-line block comment:

    /* comment line 1
         line 2
          line 3        */  GO
    
  3. multiple block comments (no space between them!):

    /* comment line 1
         line 2 *//* start of #2 
                 */            GO 4
    
  4. batch terminator embedded in a multi-line comment should be ignored:

    /* comment line 1
    GO
     more comments */
    
  5. batch terminator embedded in a multi-line string literal should be ignored:

    ' some text
    GO
     more text'