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
Incorrect syntax near GO
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?
I'm afraid that this error message you receive from database engine.
BTW: what kind of database do you use?
Incorrect syntax near GO
USE MASTER
GO
DROP DATABASE DB_Name
GO
the db is SQL2008
Thanks
Thomas
GO
DROP DATABASE DB_Name
GO
the db is SQL2008
Thanks
Thomas
Incorrect syntax near GO
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.
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.