Invalid syntax next to "GO" - TADOQuery

Possible duplicate:
How to run a script database file from Delphi?

I have a really long sql script to run with a query, it updates fields, creates tables, creates procedures, etc. So, there is a lot of the word "GO", otherwise it will not function properly,

In the MSSQL query, the script works fine, whereas in ADO Query I get the following:

Invalid syntax near 'GO'

EDIT: Well, I think we realized that ADO Query would not read the word GO. However, without the word GO, my code will not work, the procedures should be created on the first line, and I have a couple of those that were thrown around the file. This is problem.

The only workaround would then be to create separate queries?

+3
source share
3 answers

Yes. Delete GO- it is not valid SQL.

This syntax is specific to Microsoft SQL utilities - see MSDN .

Tells the end of the Transact-SQL statement package to SQL Server utilities .

(emphasis mine)

+3
source

Go is a batch terminator, it is not SQL, it is understood by SSMS. Just uninstall GO at startup from ADO

+1
source

GO is not a SQL command. This is a batch terminator recognized by SSMS.

+1
source

All Articles