Article View: bu.localpostings
Article #337Using a trigger to cascade updates to another database( comp.databases.ms-sqlserver)
From: Thomas Dauria
Date: Tue, 28 Dec 1999 00:00
Date: Tue, 28 Dec 1999 00:00
27 lines
1375 bytes
1375 bytes
X-Orig-MsgId: <84b7a2$19v$1@news1.bu.edu>
I want to update a field in another database whenever I change the
value of people_id. The other database name is SPH_Admissions and
the database containing this trigger is SPH_Resources and the table
name is tblPeople. The table in SPH_Admissions that should be
updated is called Names.
The syntax checker accepts the code below but when it executes it
complains that it can't find SPH_Admissions.Names
How do I reference it?
Thanks in advance .... Tom
/*
* CASCADE UPDATES TO 'Admissions Database Faculty Advisors 1'
*/
IF UPDATE(people_id)
BEGIN
UPDATE SPH_Admissions.Names
SET SPH_Admissions.Names.Advisor1UID = inserted.people_id
FROM SPH_Admissions.Names, deleted, inserted
WHERE deleted.people_id = SPH_Admissions.Names.Advisor1UID
END
/*
Technical Details
Message-ID:
<84b7a7$1jn$1@news1.bu.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1552e4,7175f94a051b7dc6,start
X-Google-Attributes: gid1552e4,public
From: Thomas Dauria <tdauria@bu.edu>
Subject: Using a trigger to cascade updates to another database( comp.databases.ms-sqlserver)
Date: 1999/12/28
Message-ID: <84b7a7$1jn$1@news1.bu.edu>
X-Deja-AN: 565777361
Organization: Boston University
X-Orig-Newsgrp: comp.databases.ms-sqlserver
User-Agent: tin/1.4-19991113 ("No Labels") (UNIX) (AIX/4-2)
Newsgroups: bu.localpostings