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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:55:40+00:00 2026-05-23T14:55:40+00:00

apologies is this is a very simple question but I can’t seem to find

  • 0

apologies is this is a very simple question but I can’t seem to find an answer anywhere..

When running a query using the UNION ALL query (as shown below) does SQL ensure that the locks are placed on both tables prior to data acquisition or is it the case that the locks are placed independently on each table, as appears to be the case from looking at the execution plan.

select i from T1 with (updlock, holdlock) 
UNION ALL 
select i from T2 with (updlock, holdlock)
  • 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-23T14:55:41+00:00Added an answer on May 23, 2026 at 2:55 pm

    A updlock will be taken on each row, from each table, as it is read. Depending on the size of the tables, you may see escalation. If you want to force locks on both tables prior to any data being read, specify the tablock hint.

    Fire up Profiler, create an empty trace definition, filter to your test database and add just Lock:Acquired, Lock:Released events and you can see the sequence.

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

Sidebar

Related Questions

Sorry if this question may be simple, but I can't seem to find an
Apologies for the rather simple question, I just can't seem to find ANY good
I apologies for this being a very simple question but as a first time
Apologies if this is a very basic question, but I am preparing to create
I have a very novice question, so apologies if the answer to this is
My apologies if this is a stupid question, however I can't find any information
Apologies, as this may seem a very weird question. All of my experience in
This is a very wide-ranging/vague question, but here goes. Apologies in advance. The app
Apologies if this is a very simple question; I don't use XSLT very much
Apologies if this question has been asked. I couldn't find it, but if it

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.