Incorrect syntax near ’GO’

Discuss RoboTask here
Post Reply
thjmcd
Posts: 7
Joined: Wed Dec 14, 2011 6:40 am
Location: Ireland

Incorrect syntax near ’GO’

Post by thjmcd »

Hi,
I am trying to run a SQL query using "GO".
When I run the task in Robotask I get an error returned -

E: 05/01/2012 11:38:09: Error has occurred: Incorrect
syntax near 'GO'

The Query is correct as when I run it in SQL the script
preforms as expected.
Is there an alternative to GO I can use in robotask?

Thomas
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Incorrect syntax near ’GO’

Post by Oleg »

Send full text of SQL query that you use.
I'm afraid that this error message you receive from database engine.

BTW: what kind of database do you use?
thjmcd
Posts: 7
Joined: Wed Dec 14, 2011 6:40 am
Location: Ireland

Incorrect syntax near ’GO’

Post by thjmcd »

USE MASTER
GO
DROP DATABASE DB_Name
GO

the db is SQL2008

Thanks
Thomas
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Incorrect syntax near ’GO’

Post by Oleg »

This is a batch of SQL expressions. "SQL query" action is designed for use single expression like:
INSERT
DELETE
UPDATE
CALL
etc.

For example Oracle database allows to use simple trick - run dynamic procedure.
Like this:
BEGIN
   DECLARE CNT;
   select count(*) from table1 into CNT;
   update table2 set field1=cnt where id = 1;
END
This is not a batch, this is single expression.

But I'm afraid that many databases have no such feature.
We'll add the SQL Batch action in future.
Last edited by Oleg on Thu Jan 05, 2012 5:47 pm, edited 1 time in total.
Post Reply