Groups | Blog | Home
all groups > sql server (alternate) > july 2003 >

sql server (alternate) : Update trigger on Linked Server View


simonfunston
7/30/2003 2:17:29 PM

Hi there,

I'm pretty new to SQL and am having some porblems with a linked server.
I have a table on a SQL server which stores employee information.
I also have a view on a linked server which stores the same information.

What I would like to happen is, whenever the view changes on the linked
server I want the information to be changed in the table on my server.

I've been trying to write a trigger to do this, but have had no
luck so far.

Can anyone help me?

Thanks

Simon

--
simonfunston
7/30/2003 3:46:41 PM

This is the trigger I've written:

CREATE TRIGGER fnChangeData

ON PSREP..SYSADM.PS_ML_UK_EXTR_AMS

FOR UPDATE

AS

SET XACT_ABORT ON

UPDATE t

SET
LAST_NAME_SRCH = i.LAST_NAME_SRCH,
FIRST_NAME_SEARCH = i.FIRST_NAME_SEARCH

FROM Employee t JOIN inserted i ON t.EMPLID = i.EMPLID


And the error I get:

Server: Msg 117, Level 15, State 1, Procedure fnChangeData, Line 5
The object name 'PSREP..SYSADM.' contains more than the maximum number
of prefixes. The maximum is 2.

Is this because you can't run a trigger on a linked table? I've tried
using openquery as well, but with no success.

Any help much appreciated,

Simon

--
AddThis Social Bookmark Button