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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:01:55+00:00 2026-06-12T09:01:55+00:00

I just realized that I fundamentally don’t understand how .NET/SQL Server transactions work. I

  • 0

I just realized that I fundamentally don’t understand how .NET/SQL Server transactions work. I feel like I might pushing the envelop on “there’s no such thing as a dumb question”, but all of the documentation I’ve read is not easy to follow. I’m going to try to phrase this question in such a way that the answer will be pretty much yes/no.

If I have a .NET process running on one machine that is effectively doing this (not real code):

For i as Integer = 0 to 100
    Using TransactionScope
        Using SqlClient.SqlConnection
            'Executed using SqlClient.SqlCommand'
            "DELETE from TABLE_A"
            Thread.Sleep(5000)
            "INSERT INTO TABLE_A (Col1) VALUES ('A')"
            TransactionScope.Complete()
        End Using
    End Using
Next i

Is there any Transaction / Isolation-Level configuration that will make ‘SELECT count(*) FROM TABLE_A’ always return ‘1’ when run from other processes (i.e. even though there are 5 second chunks of time when there are no rows in the table in the context of the transaction)?

  • 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-12T09:01:56+00:00Added an answer on June 12, 2026 at 9:01 am

    Yes, you can make other processes not see the changes you do in the transaction shown. To do that you need to alter the other processes, not the one making the modification.

    Turn on snapshot isolation and use IsolationLevel.Snapshot on the other reading processes. They will see the table in the state right before you made any modifications. They won’t block (wait).

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

Sidebar

Related Questions

I just realized that SQL server '=' comparator when used for text comparison is
I am testing my webpage on a server using preview dns. Just realized that
I just realized that I don't see a way to collect a string from
I just realized that my paypal ipn handler in php doesn't work anymore (and
I just realized that in Eclipse one cannot collapse code blocks like {} .
I just realized that I don't have a answer to this question, when I'm
I just realized that this piece of code works well in Firefox but not
I just realized that the MySQLWorkBench destroys the target (makes a replacement) when performing
I just realized that I need to synchronize a significant amount of data collection
I just realized that the method Element.getElementsByTagName(someTagName) returns a nodelist of all elements in

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.