0
votes

I am facing issue during delete a record from Link Server.

DELETE
FROM [ABC].[novasystem]..[tbl_missing_lims_ord]
WHERE lims_order_id = '1247552'

Error:

OLE DB provider "MSDASQL" for linked server "ABC" returned message "[MySQL][ODBC 8.0(a) Driver][mysqld-8.0.21]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.tbl_missing_lims_ord WHERE Order_id=? AND collection_date=? AND patient_' at line 1". Msg 7345, Level 16, State 1, Line 1 The OLE DB provider "MSDASQL" for linked server "ABC" could not delete from table "novasystem.tbl_missing_lims_ord`". There was a recoverable, provider-specific error, such as an RPC failure.

I have also used Openquery command but still error.

Delete openquery([ABC],'select * from tbl_missing_lims_ord where lims_order_id=1247552')

OLE DB provider "MSDASQL" for linked server "ABC" returned message "[MySQL][ODBC 8.0(a) Driver][mysqld-8.0.21]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.tbl_missing_lims_ord WHERE Order_id=? AND collection_date=? AND `patient_' at line 1". Msg 7345, Level 16, State 1, Line 5 The OLE DB provider "MSDASQL" for linked server "ABC" could not delete from table "select * from tbl_missing_lims_ord where lims_order_id=1247552". There was a recoverable, provider-specific error, such as an RPC failure.

I have checked that the RPC and RPC Out are set to TRUE on the LinkedServer’s properties.

Can anyone guide me how I can remove the error?

DELETE FROM [ABC].[novasystem].[tbl_missing_lims_ord] WHERE lims_order_id='1247552' ?gotqn
MySQL <> SQL Server - please correct your tags.Dale K
@DaleK I think both tags are OK here. OP is trying to delete from a MySQL table via a Linked Server connection on SQL Server.AlwaysLearning
In that case OP should clarify, because its not obvious that that is the case.Dale K