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

  • Home
  • SEARCH
  • 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 6324127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:38:51+00:00 2026-05-24T16:38:51+00:00

I’m using insert-/update triggers to update a second table’s column Price . The insert

  • 0

I’m using insert-/update triggers to update a second table’s column Price.

The insert trigger seems to work perfectly, but when I try to change a single record in SSMS, I get an error:

The row value(s) updated or deleted either do not make the row
unique or they alter multiple rows(2 rows).

This is my update-trigger:

CREATE TRIGGER [dbo].[trgUpdateMasterData] ON [dbo].[tabSparePartMasterData_Temp]
AFTER UPDATE
AS

UPDATE    tabSparePart
SET      Price = MD.Price
FROM    tabSparePart INNER JOIN
(
    SELECT     inserted.[Material Number (SAP)] AS MaterialNumber, inserted.Price
    FROM          inserted
    GROUP BY [Material Number (SAP)], inserted.Price
) MD 
ON tabSparePart.SparePartName = MD.MaterialNumber

I need to group by Material-Number because there are redundant rows inserted into table tabSparePartMasterData_Temp which i’m only using to update the Sparepart-Price in tabSparePart. But i assumed that the group by would sort out the duplicates(Price is same for any duplicate).

It’s possible that the inserted/updated records’ MaterialNumber is not available in tabSparepart. In this case this record should be “skipped”. Does the INNER JOIN takes that into account?

  • 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-24T16:38:52+00:00Added an answer on May 24, 2026 at 4:38 pm

    Try adding SET NOCOUNT ON to the trigger

    This error doesn’t look like a SQL error and I’m guessing the client code is getting confused by the 2nd update in the trigger.

    Edit: this error can be caused by the data grid view in SSMS being silly.

    This isn’t a SQL message as I thought: it is an SSMS being stupid message

    See these which all says “learn to write SQL”

    • http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/dealing-with-the-row-value-s-updated-or (Less than dot blog)
    • Trigger that modifies multiple rows on diffrent table then it was invoked on in SQL Server 2005
    • SSMS permits duplicate records in a table, but not subsequent updates

    Saying that, there is a KB article about a bug in SQL Server 2005…

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

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains

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.