Insert trigger for bulk insert

Insert trigger for bulk insert

Post by SklNLkg » Mon, 27 Nov 2006 03:46:02


In case of a bulk insert, the OR INSERTtrigger fires for each recod or
only once?
Thanks,
 
 
 

Insert trigger for bulk insert

Post by Arnie Rowl » Mon, 27 Nov 2006 04:10:49

Only once, and ALL of the rows are in the inserted table.

--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc

Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous

You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf

 
 
 

Insert trigger for bulk insert

Post by Dan Guzma » Mon, 27 Nov 2006 05:13:38

To add to Arnie's response, the trigger is fired one for each batch of
records and only if FIRE_TRIGGERS is specified.

--
Hope this helps.

Dan Guzman
SQL Server MVP
 
 
 

Insert trigger for bulk insert

Post by Sm9obiBCZW » Mon, 27 Nov 2006 05:16:02

Hi Jim

The BULK INSERT statement has a FIRE_TRIGGERS option and BCP has it as a
hint, to make INSERT triggers fire. See Books Online for more.

John