Re: getting values from inserted table
From: Alto (CraigGoogle_at_Yahoo.com)
Date: 03/12/04
- Next message: Al: "RE: European Dayofweek?"
- Previous message: Alto: "Re: identiy_insert and data generators"
- In reply to: Brian Henry: "getting values from inserted table"
- Next in thread: David Portas: "Re: getting values from inserted table"
- Reply: David Portas: "Re: getting values from inserted table"
- Reply: Brian Henry: "Re: getting values from inserted table"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 12 Mar 2004 06:10:15 -0800
You can bind muliple columns to variables using the following SELECT
syntax:
declare @Var1 int
declare @Var2 int
declare @Var3 int
select @Var1=Col1, @Var2=Col2, @Var3=Col3
from inserted
Also, watch out: the inserted virtual table can have multiple rows. The
vast majority of time when you're testing your trigger you'll be
inserting a single row at a time, but that does not mean that a
multi-row insert will never happen. If you test the record count when
the trigger starts you can raise an error that lets the caller know that
inserts must be serialized due to the way your code works. This will be
a lot less mysterious a year from now when everyone has forgot all about
the trigger.
-- Craig Yellick, Alto
http://altoConsulting.com
http://altoTraining.com
http://altoCRM.com
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
- Next message: Al: "RE: European Dayofweek?"
- Previous message: Alto: "Re: identiy_insert and data generators"
- In reply to: Brian Henry: "getting values from inserted table"
- Next in thread: David Portas: "Re: getting values from inserted table"
- Reply: David Portas: "Re: getting values from inserted table"
- Reply: Brian Henry: "Re: getting values from inserted table"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|