Re: tigger in inserted records
From: joia (joia_at_discussions.microsoft.com)
Date: 06/30/04
- Next message: Sunanda: "Re: login security question"
- Previous message: JohnnieO: "Re: Cluster @#$ked"
- In reply to: Adam Machanic: "Re: tigger in inserted records"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 30 Jun 2004 07:15:02 -0700
this is the trigger, that picks up the inserted string and substrings it to the target table,
CREATE TRIGGER trigger11 ON [dbo].[Fact_Tote_Tmp]
FOR insert
AS INSERT INTO Fact_Tote_ds (Type,Datetime,DecisionpointID, CategoryID, ToteID, WorklistID, DestinationID)
SELECT SUBSTRING(tote_string, 1, 2), substring(tote_string,3,30), substring(tote_string,33,4)stID, substring(tote_string,37,2), substring(tote_string,39,8), substring(tote_string,47,8), substring(tote_string,55,4)
FROM Fact_Tote_Tmp
WHERE tote_string NOT IN (SELECT TYPE+DateTime+DecisionpointID+CategoryID+ToteID+WorklistID+DestinationID FROM Fact_Tote_ds)
"Adam Machanic" wrote:
> What's the trigger doing? Can you post DDL for the table, the code for the
> trigger, and a brief description of what you're trying to accomplish with
> it?
>
>
> "joia" <joia@discussions.microsoft.com> wrote in message
> news:E63FFF8B-94BD-45CC-BA09-DA19CA739A85@microsoft.com...
> > Hi, I have a trigger on inserted records. However, the trigger doesn't
> only work on the newly inserted records, but also on the records that were
> already in the table. How can I make sure that the trigger only works on
> newly inserted records
>
>
>
- Next message: Sunanda: "Re: login security question"
- Previous message: JohnnieO: "Re: Cluster @#$ked"
- In reply to: Adam Machanic: "Re: tigger in inserted records"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|