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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:29:00+00:00 2026-05-13T21:29:00+00:00

Why is that, with default settings on Sql Server (so transaction isolation level =

  • 0

Why is that, with default settings on Sql Server (so transaction isolation level = read committed), that this test:

CREATE TABLE test2 (
ID bigint,
name varchar(20)
)

then run this in one SSMS tab:

begin transaction SH
insert into test2(ID,name) values(1,'11') 
waitfor delay '00:00:30'
commit transaction SH

and this one simultaneously in another tab:

select * from test2

requires the 2nd select to wait for the first to complete before returning??

We also tried these for the 2nd query:

select * from test2 NOLOCK WHERE ID = 1

and tried inserting one ID in the first query and selecting a different ID in the second.

Is this the result of page locking? When running the 2 queries, i’ve also ran this:

select object_name(P.object_id) as TableName, resource_type, resource_description
from
sys.dm_tran_locks L join sys.partitions P on L.resource_associated_entity_id = p.hobt_id

and gotten this result set:

test2 RID 1:12186:5
test2 RID 1:12186:5
test2 PAGE 1:12186
test2 PAGE 1:12186

  • 1 1 Answer
  • 1 View
  • 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-13T21:29:01+00:00Added an answer on May 13, 2026 at 9:29 pm

    requires the 2nd select to wait for
    the first to complete before
    returning??

    read commited prevents dirty reads and by blocking you will get a consistent result, snapshot isolation gets around this but you will get slightly worse performance because now sql server will hold the old values for the duration of the transaction (better have your tempdb on a good drive)

    BTW, try changing the query from

    select * from test2
    

    to

    select * from test2 where id <> 1 
    

    assuming you have more than 1 row in the table and it will be over a page, insert a couple of thousand rows

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

Sidebar

Related Questions

I have a function that restores all of the default settings of my application.
I've implemented that default swipe-to-delete gesture in UITableView, and now I feel that this
I have a standard php app that uses SQL Server as the back-end database.
I have a view that joins SQL Server tables on linked servers. There are
This error occurs when I was trying to connect to SQL Server 2005 which
I am creating a script that will be run in a MS SQL server.
After setting up a replication on my server (SQL2005) I have noticed that default
Background: we moved from Sql Server 2005 to Sql Server 2008 R2. This application
I downloaded the 53.5 MB setup of SQL Server 2005 Express from this URL:
I've created a Winform that connects to SQL Server Express x64 using Trusted Connection

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.