Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 958683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:54:22+00:00 2026-05-16T00:54:22+00:00

On bulk insert, Insert trigger only works for the first record and does not

  • 0

On bulk insert, Insert trigger only works for the first record and does not work for all the other records but trigger works properly when records are inserted using cursor.

Insert trigger updates few columns of destination table. To insert bulk data I am using following script

INSERT INTO DestinationTable (Column1, Column2)
SELECT * FROM SourceTable

I get few columns in trigger of inserted record like the following script, and work on them to update columns of DestinationTable

SELECT @col1 = Column1, @col2 = Column2, FROM INSERTED
  1. Why on bulk insert, trigger does not
    work?
  2. Am I missing something or I have to
    use cursor?

I am using SQLServer 2005

EDIT

Trigger Code

http://stashbox.org/957108/InsertTrigger.sql

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T00:54:22+00:00Added an answer on May 16, 2026 at 12:54 am

    From the code you posted it looks like by bulk insert you just mean inserting multiple rows. Not this BULK INSERT?

    The INSERTED pseudo table contains all the rows inserted by the statement. It is not a row level trigger. You would need to use a cursor for RBAR processing or, ideally, process it as a set. For example if you are Updating another table you could join onto the inserted table and update all the rows in one statement.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing a bulk insert of records into a database from a log
Possible Duplicate: Bulk Insert of hundreds of millions of records So I was just
I have problem for bulk insert of the file.I am saving the multiple record
I'm doing a bulk insert but before inserting into the actual table I need
Does anyone know if its possible to use Bulk insert from following code: FORALL
I want to bulk insert about 700 records into the Android database on my
I want to bulk insert all rows from one table to another. I am
I came across the .import command to do this (bulk insert), but is there
I'm using Ocilib to perform a bulk insert on a Oracle database but I'm
I am doing a BULK INSERT into sqlserver and it is not inserting UTF-8

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.