Why can't I use a GO in a stored-procedure?

A. GO is not a T-SQL command. It is a batch delimiter but it is parsed and processed by the front end query tool - e.g. ISQL, OSQL, ISQL/W etc.

When the front-end sees a go it sends the previous batch of SQL to SQL Server for processing. SQL Server never sees the go command and wouldn't understand it if it did.


Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish