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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:52:19+00:00 2026-06-10T19:52:19+00:00

Given the following scenario: A select statement is executed from Sql Server Management Studio

  • 0

Given the following scenario:
A select statement is executed from Sql Server Management Studio (2005, 2008) to retrieve a large resultset. This is not done by choosing ‘Edit top 200 rows’ from the context menu.

Our DBA says that it’s possible this can lock the table being queried. Unlocking occurs when the query results are closed.

I can’t find any documentation that confirms this is true.
So, fact or fiction?

Edit:
Selected Aaron’s answer, and thumbs up to Yuri and Lloyd for helpful answers.

Regards,

Michel

  • 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-10T19:52:20+00:00Added an answer on June 10, 2026 at 7:52 pm

    A SELECT is run once, and the shared locks (not exclusive locks!) are released once the data has completed being read. This may coincide precisely with the last row being displayed on the client, but it may occur a few milliseconds before. The fact that the results are open on the client is not known by SQL Server (unless we are talking about “Open Table” / “Edit Top 200 Rows”). I don’t think it’s possible with a single SELECT statement to lock the table in the way you describe – other readers and writers should be able to operate on the table just fine, though there may be some contention (not exclusive locking) while your SELECT is running.

    A way you could simulate this, however, is to do some combination of…

    SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
    BEGIN TRANSACTION;
    SELECT * FROM dbo.table WITH (TABLOCKX);
    

    …and then go to lunch.

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

Sidebar

Related Questions

Given the following table in SQL Server 2005: ID Col1 Col2 Col3 -- ----
Given following Statment: String query = "Select * from T_spareParts where SparePartPK IN (?
The following scenario is given: /Collection1 (a number of users are subscribed to this
I am running the following feature: Scenario: viewing existing images Given I am on
I have the following scenarios: Scenario: Create a game with valid information Given I
Given the following HTML selects: <select id=HtmlSelect1> <option value=1 selected=selected>1</option> <option value=2>2</option> <option value=3>3</option>
I have the following SQL problem. Scenario: I have two tables: Change and ChangeTicket.
Given the following scenario, I would like to know if functionOneLock releases itself before
Given the following scenario, which one of the following is preferred. m_state is a
I'd like to know what happens given the following scenario using the .net client.

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.