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

Ask A Question

Stats

  • Questions 512k
  • Answers 512k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Two things. Are you sure that the URL /blockseek3-9-2010/JsonWebService.asmx/GetList is… May 16, 2026 at 5:31 pm
  • Editorial Team
    Editorial Team added an answer Question: How to retrieve container which contain cars from different… May 16, 2026 at 5:30 pm
  • Editorial Team
    Editorial Team added an answer I think you can only get but not set. flash.Lib.current.stage.stageWidth… May 16, 2026 at 5:30 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm performing a bulk insert with an ADO.NET 2.0 SqlBulkCopy object from a C#
I'm doing a bulk insert of a CSV file into SQL Server 2005, using
How do I bulk insert with SQLite? I looked it up and it seems
I have a bulk insert command that I am issuing through C#. Is the
I'm doing a bulk insert from a fixed width text file using INSERT INTO
Below is a SQL Server 2005 update trigger. For every update on the email_subscriberList
As we all know, CTEs were introduced in SQL Server 2005 and the crowd
I am not sure I am getting the correct definition for what API Usage
A while back when I was performing some bulk inserts of data into my
Cusid Cusgroupid Productid 5 NULL NULL ppid cusgroupid list bulk cost billing 854 NULL

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.