I'm trying to use the following code to execute a
DELETE statement on a linked server. I'm trying to delete all records from the remote server where there is a match on a certain ID field in both the table on the linked server and a local table. Any records showing up in the
INNER JOIN should be deleted from the linked server table
The following isn't allowing me to use an alias ("RemoteTable") for my remote table. Am I on the right track here with what I'm trying to accomplish? Thanks!
DELETE FROM OPENQUERY(LINKEDSERVER_MYSQL,'SELECT * from PrimaryInquiry_T2') AS RemoteTable
INNER JOIN Forms.dbo.PrimaryInquiry_TLOCAL AS LocalTable
ON LocalTable.PrimaryInquiry_TLOCAL_EntryID = RemoteTable.PrimaryInquiry_T2_EntryID