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 7733219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:55:50+00:00 2026-06-01T06:55:50+00:00

If there are more than one rows in my source that do not match

  • 0

If there are more than one rows in my source that do not match my target, and inserting one causes a match (and would cause there to be no NOT MATCHED had it been present), am I safe in the assumption that all will get merged? That is, the records in the source that will be merged are identified and destined to merge before any of them are added? That’s how it appears to work and nothing below contradicts it but I’m not sure it’s a definitive guarantee.

Johnny Microsoft says:

WHEN NOT MATCHED [ BY TARGET ] THEN

Specifies that a row is inserted into target_table for every row returned by

<table_source> ON <merge_search_condition> that does not
match a row in target_table, but does satisfy an additional search
condition, if present. The values to insert are specified by the
<merge_not_matched> clause. The MERGE statement can have only one WHEN
NOT MATCHED clause.

  • 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-06-01T06:55:51+00:00Added an answer on June 1, 2026 at 6:55 am

    The merge scans every row, and it only makes one pass through the data. Therefore, all the records that satisfy your WHEN MATCHED clause at the time your statement is executed will be affected, and only the records that satisfy the WHEN NOT MATCHED clause at the time the statement is executed will be affected.

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

Sidebar

Related Questions

EDIT: For the inner queries, there could be more than one match per inner
I know there is more than one question out there that matches this, but
There are more than one solution for finding the-number-of-digits in a given number. For
If there is more than one way, please list them. I only know of
Yes, There's More Than One Way To Do It but there must be a
There may be more than one way to ask this question, so here's a
Are there any scenarios where more than one Box2D worlds are needed in one
Is there a way to update more than one Database having same schema using
Is there a way to set the fetchmode to eager for more than one
is there a way to configure trac to use more than one svn repo

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.