dbTalk Databases Forums  

trigger will not execute

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss trigger will not execute in the microsoft.public.sqlserver.dts forum.



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

Default trigger will not execute - 06-06-2006 , 11:59 AM






I have two similar triggers one on solodata table and one on components table.
I cannot get the trigger on solodata to execute. I have pasted it below.
Below that
I hve pasted the one on components that does run. i checked and extn5 does
change, and the groupid in solodata is 66, I would appreciate any help on why
this is not running.


CREATE TRIGGER [SDLineNo] ON [Solodata]
FOR INSERT, UPDATE
AS

IF UPDATE (ExtN5)
BEGIN

DECLARE @SDL INT
SELECT @SDL = SOLODATALINK FROM INSERTED

UPDATE SOLODATA
SET IsoText = ReportedLineNo
FROM Components CP inner join Solodata SD ON CP.solodatalink =
sd.solodatalink
inner join Commondata CD ON
CP.commondatalink = cd.commondatalink
WHERE sd.GroupID IN (1,6,17,28,51,52,53,55,62,66,67,68) AND sd.ExtN5=1
and SD.solodatalink = @SDL
END

**********THIS IS THE ONE THAT WORKS
CREATE TRIGGER [IsoTextLineNo] ON [Components]
FOR INSERT, UPDATE
AS

IF UPDATE(COMMONDATALINK)
BEGIN

UPDATE SOLODATA
set ISOTEXT =
REPORTEDLINENO + '$VENT/DRAIN/INST$/MD-110 DEG$SEE ' + COMPONENTDESCRIPTION
FROM inserted i inner join commondata cd on i.commondatalink =
cd.commondatalink, solodata, components
where solodata.groupid = 69
and solodata.SoloDataLink = Components.solodatalink
and Components.CommonDataLink = CD.CommonDataLink

--need to have the code below put on solodata table also for change in extn5
UPDATE SOLODATA
set ISOTEXT =
REPORTEDLINENO
FROM inserted i inner join commondata cd on i.commondatalink =
cd.commondatalink, solodata, components
where Solodata.GroupID IN (1,6,17,28,51,52,53,55,62,66,67,68) AND
Solodata.ExtN5=1
and solodata.SoloDataLink = Components.solodatalink
and Components.CommonDataLink = CD.CommonDataLink

END

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

Default RE: trigger will not execute - 06-06-2006 , 01:26 PM






sorry this should have been posted in programming not dts

"Cynthia" wrote:

Quote:
I have two similar triggers one on solodata table and one on components table.
I cannot get the trigger on solodata to execute. I have pasted it below.
Below that
I hve pasted the one on components that does run. i checked and extn5 does
change, and the groupid in solodata is 66, I would appreciate any help on why
this is not running.


CREATE TRIGGER [SDLineNo] ON [Solodata]
FOR INSERT, UPDATE
AS

IF UPDATE (ExtN5)
BEGIN

DECLARE @SDL INT
SELECT @SDL = SOLODATALINK FROM INSERTED

UPDATE SOLODATA
SET IsoText = ReportedLineNo
FROM Components CP inner join Solodata SD ON CP.solodatalink =
sd.solodatalink
inner join Commondata CD ON
CP.commondatalink = cd.commondatalink
WHERE sd.GroupID IN (1,6,17,28,51,52,53,55,62,66,67,68) AND sd.ExtN5=1
and SD.solodatalink = @SDL
END

**********THIS IS THE ONE THAT WORKS
CREATE TRIGGER [IsoTextLineNo] ON [Components]
FOR INSERT, UPDATE
AS

IF UPDATE(COMMONDATALINK)
BEGIN

UPDATE SOLODATA
set ISOTEXT =
REPORTEDLINENO + '$VENT/DRAIN/INST$/MD-110 DEG$SEE ' + COMPONENTDESCRIPTION
FROM inserted i inner join commondata cd on i.commondatalink =
cd.commondatalink, solodata, components
where solodata.groupid = 69
and solodata.SoloDataLink = Components.solodatalink
and Components.CommonDataLink = CD.CommonDataLink

--need to have the code below put on solodata table also for change in extn5
UPDATE SOLODATA
set ISOTEXT =
REPORTEDLINENO
FROM inserted i inner join commondata cd on i.commondatalink =
cd.commondatalink, solodata, components
where Solodata.GroupID IN (1,6,17,28,51,52,53,55,62,66,67,68) AND
Solodata.ExtN5=1
and solodata.SoloDataLink = Components.solodatalink
and Components.CommonDataLink = CD.CommonDataLink

END

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.