1

I'm getting the syntax error of Incorrect syntax near 'GO'. I tried a few methods and one of them worked. Anyone can explain it to me?

Source for invoke-sqlcmd2: https://github.com/RamblingCookieMonster/PowerShell/blob/master/Invoke-Sqlcmd2.ps1

Worked:

Invoke-Sqlcmd2 -Query "SELECT 1 FROM TableA GO"

Didn't work:

Invoke-Sqlcmd2 -Query "Print 123 GO"
Nerdynosaur
  • 1,798
  • 9
  • 32
  • 61
  • 2
    Possible duplicate of [Incorrect syntax near 'GO'](http://stackoverflow.com/questions/25680812/incorrect-syntax-near-go) – Martin Brandl Nov 21 '16 at 10:12

1 Answers1

0

As far as I know, you don't need the 'GO' command.

Varusal
  • 15
  • 1
  • 7