dbTalk Databases Forums  

Update trigger on Linked Server View

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Update trigger on Linked Server View in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
simonfunston
 
Posts: n/a

Default Update trigger on Linked Server View - 07-30-2003 , 09:17 AM







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

--
Posted via http://dbforums.com

Reply With Quote
  #2  
Old   
simonfunston
 
Posts: n/a

Default Re: Update trigger on Linked Server View - 07-30-2003 , 10:46 AM







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

--
Posted via http://dbforums.com

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.