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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:59:31+00:00 2026-06-01T05:59:31+00:00

SQL Server is SQL Azure, basically it’s SQL Server 2008 for normal process. I

  • 0

SQL Server is SQL Azure, basically it’s SQL Server 2008 for normal process.

I have a table, called TASK, constantly have new data in (new task), and removed (task complete)

For new data in, I use INSERT INTO .. SELECT ..., most of time takes very long, lets say dozen of minutes.

For old data out, I first use SELECT (WITH NOLOCK) to get task, UPDATE to let other thread know this task already starts to process, then DELETE once finished.

Dead lock sometime happens on SELECT, most time happens on UPDATE and DELETE.

this is not time critical task, so I can start process the new data once all INSERT finished. Is there any kind of LOCK to ask SELECT not to select it before the INSERT finished? Or any kind of other suggestion to avoid Conflict. I can redesign table if needed.

  • 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-01T05:59:33+00:00Added an answer on June 1, 2026 at 5:59 am

    later the sqlserver2005,resolve lock is easy.
    for conflict
    1.you can use the service broker.
    2.use the isolution level.

    dbcc useroptions ,at last row ,you can see the deflaut isolution level is read_committed,this is the session level.
    we can change the level to read_committed_snapshot for conflict,in sqlserver, not realy row lock like oracle.but we can use this method implement.

    ALTER DATABASE DBName
    SET READ_COMMITTED_SNAPSHOT ON;

    open this feature,must in single user schame.

    and you can test it.
    for session A ,session B.

    A:update table1 set name = ‘new’ with(Xlock) where id = 1
    B:you still update other row and select all the data from table.

    my english is not very good,but for lock ,i know.

    in sqlserver,for function ,there are three locks.
    1.optimistic lock ,use the timestamp(rowversion) control.
    2.pessimism lock ,force lock when use the date.use Ulock,Xlock and so on.
    3.virtual lock,use the proc getapplock().

    if you need lock schame in system architecture,please me email : mjjjj2001@163.com

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

Sidebar

Related Questions

SQL Server 2008 Database Question. I have 2 tables, for arguments sake called Customers
I have SQL Server 2008 R2 Express installed on Azure VM Role (1 extra
I am trying to migrate a database from SQL Server 2008 to SQL Azure.
I have been assigned the task of converting an SQL Server Database to an
What's the best way to move a normal SQL server database to SQL Azure?
I have a large (~ 40gb ) SQL Server 2008 database that I would
I need to download data from windows azure table storage back to a SQL
We have a web based (ASP.NET MVC) application that uses SQL Server 2008 for
SQL Server 2008 Profiler always profiles all databases. I want to restrict profiling or
SQL Server 2005 Profiler shows that a Stored Procedure (SP) was called and what

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.