i created a linked Mysql server on SQL server 2008 r2. i'm trying to create a trigger on sql table that automatically updates a field in the linked server table, i have a table called "QFORCHOICE" in sql that has fields "Prodcode,prodname and avqty" and a table "que_for_choie" in mysql that has fields "procode,proname and avqty" i want the trigger to update the value of "procode" in the linked server if the value of "prodcode" in sql server changes. this is what i have so far but it has errors,
create trigger [QFORCHOICE]
ON dbo.QFORCHOICE
FOR INSERT
AS
DECLARE @prodcode numeric(18,0)
DECLARE @prodname varchar(50)
DECLARE @avqty numeric(18,0)
BEGIN
SELECT
@procode = procode,
@proname = proname,
@avqty = avqty
FROM inserted
update [LINKED_MYSQL].[que_for_choice]
SET prodname=@prodname,avqty=@avqty
WHERE prodcode = @prodcode
end
can anybody please help. thanks in advance