Page 1 of 1

Incorrect syntax near ’GO’

Posted: Thu Jan 05, 2012 8:42 am
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

Incorrect syntax near ’GO’

Posted: Thu Jan 05, 2012 9:06 am
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?

Incorrect syntax near ’GO’

Posted: Thu Jan 05, 2012 9:22 am
by thjmcd
USE MASTER
GO
DROP DATABASE DB_Name
GO

the db is SQL2008

Thanks
Thomas

Incorrect syntax near ’GO’

Posted: Thu Jan 05, 2012 1:17 pm
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.