Hi, we have one local copy of a table stored in SQL Server and one website copy of a table stored in MySQL.
At the end of the night I want all changes to the SQL server updated to the website on this table.
I thought in my very limited knowledge that a trigger might be the way to go. The trigger would tell me which SQL Server columns had been changed as follows
I'd then just update the columns that had 1 for webupdate.Code:Create trigger dbo.testtrig on dbo.employees for update as begin declare @empid int declare @webup bit set @webup = (select Webupdate from inserted) If @webup = 0 set @empid = (select employeesID from inserted) update employees set webupdate = 1 where employeesID = @empid end
Does this make sense, or is this a crazy way to do things.
Basically does the above trigger look correct and what improvments can I make or a better way of doing the same thing would be good.




Reply With Quote