Hi,
I've spent hours on this. I have the following sql:
set @SSQL='SELECT * from openquery(MySqlTable,''select SampleTime,Sum(T2*.01)
FROM '+@PortSamples'
group by SampleTime'')'
INSERT INTO SQL_Server.dbo.TableA
(SampleTime,T2)
--execute the text inside the @SSQL variable
exec (@SSQL)
The problem is, sometimes the select statement will return an error because of corruption in the MySqlTable, where it cannot read 1 of the tables. This is all enclosed in a loop so I cannot remove the exec command and the variable for the table name.
How can I add error handling to simply bypass the error and continue execution ? Otherwise the SQL works mint.
Thanks for any help !!!
Paul
I've spent hours on this. I have the following sql:
set @SSQL='SELECT * from openquery(MySqlTable,''select SampleTime,Sum(T2*.01)
FROM '+@PortSamples'
group by SampleTime'')'
INSERT INTO SQL_Server.dbo.TableA
(SampleTime,T2)
--execute the text inside the @SSQL variable
exec (@SSQL)
The problem is, sometimes the select statement will return an error because of corruption in the MySqlTable, where it cannot read 1 of the tables. This is all enclosed in a loop so I cannot remove the exec command and the variable for the table name.
How can I add error handling to simply bypass the error and continue execution ? Otherwise the SQL works mint.
Thanks for any help !!!
Paul