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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:48:01+00:00 2026-05-27T16:48:01+00:00

I need to perform this SQL very frequently UPDATE Users SET UserPoint=UserPoint+(@UserPoint) WHERE UserID=@UserID

  • 0

I need to perform this SQL very frequently

UPDATE Users SET UserPoint=UserPoint+(@UserPoint) WHERE UserID=@UserID

I can allow dirty-read or dirty-write but I do not want to see deadlock, is there a way to max the chance to avoid deadlock?

EDIT

OK, @Tomtome this might not be a deadlock, thats good news for me.

Here I follow up a new question, hope you can help.

I also need to read the data, so I use

SELECT UserPoint FROM [Users] WITH (NOLOCK) WHERE UserID=@UserID

It’s not a transaction, just a simple one line SQL, and I already use the nolock, do I need to use SET TRANSACTION ISOLATION LEVEL to avoid deadlock, if I allow dirty-read.

EIDT AGAIN

I think SET ISOLATION LEVEL to READ UNCOMMITTED and WITH NOLOCK are same thing. so Done.
Thanks everyone,

  • 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-27T16:48:02+00:00Added an answer on May 27, 2026 at 4:48 pm

    is there a way to max the chance to avoid deadlock?

    No, because this statement CAN NOT DEADLOCK.

    A Deadlock requires two locks to be hold (a and b) as minimum. So one process gets lock A, waits for B, another gets B, waits for A – and nothing can be resolved by waiting. If the above statement encounters a lock it will wait (and possibly timeout), but not deadlock.

    UNLESS it is part of a larger transaction with more statements.

    So, the problem does not exist to start with 😉

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

Sidebar

Related Questions

How can I destroy such a thread that perform very long operation? I need
I've got a very frustrating SQL issue which i can't for the life of
Many (most? nearly all?) SQL dialects have a way to perform this type of
I need to perform a very simple operation on the database - put some
I am writing an SQL query in which that I will need to perform
I have an on update trigger in SQL Server 2008. I only need to
I need to update the SQL SERVER stored procedure on three different servers. I
I need to perform some action when my application receives focus. I've tried hooking
I need to perform Diffs between Java strings. I would like to be able
I need to perform a filtered query from within a django template, to get

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.