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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:46:36+00:00 2026-06-04T12:46:36+00:00

I’m looking for some guidance as to the best approach for processing data within

  • 0

I’m looking for some guidance as to the best approach for processing data within a database using SQL Server.

Basically I have a series of transient tables which are loaded with data and then series of update statements are executed against them. Multiple instances of these series of update statements run against the same table, but each instance only updates row with a specific identifier (lineage).
I’m looking to be able to confidently avoid any locking issues / deadlocks when instances are run concurrently.

The two thought I had on this are as follows:

  1. All updates statements contain the hint rowlock, so that page locks will not occur which cover different lineages.
  2. Change the isolation level – dirty reads would never actually occur.
    Can anybody shed any light on which may be the best approach to this situation?
  • 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-04T12:46:38+00:00Added an answer on June 4, 2026 at 12:46 pm

    Assuming your table looks something like:

    CREATE TABLE MyTable
    ( 
       ID INT IDENTITY(1,1),
       LineageId INT NOT NULL, -- FK to Lineage
       Col1 ...
       Col2 ...
    
       PRIMARY KEY CLUSTERED(ID),
       FOREIGN KEY LineageId REFERENCES Lineage(LineageId)
    ) 
    
    1. Recommend that you change the clustered index on your table to LineageId (but see later). This should guarantee that the fewest pages are updated if SQL does escalate your row lock to a page lock. The downside of this is that LineageId isn’t unique, so SQL will add a uniquifier. So, before changing the clustering, if your PK is incrementing and if you find that almost all rows in your table are already contiguously arranged by LineageId (e.g. if data is inserted into this table by a single threaded batch job), then clustering by an incrementing surrogate pkey would be preferable as this avoids the uniquifier (better narrowness).

    2. The ROWLOCK hint may help, although this is no guarantee.
      http://social.msdn.microsoft.com/Forums/en/sqldatabaseengine/thread/60238304-04e8-4f98-84d1-3ddf1ed786a9

    3. Setting Isolation Level to READ UNCOMMITTED or SNAPSHOT or using the (NOLOCK) hint would need to be done to the other concurrent queries to to avoid them from blocking during your LineageId updates to your table. This would be a drastic measure, and uncommitted reads can lead to integrity problems.

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

Sidebar

Related Questions

I am looking for some guideance in terms of what database to use server(using
Looking for some guidance on the best way to implement this scenario: I have
I am looking for some guidance. I have a data form field which I
Looking for some best-practice guidance. Let's say I have a line of code like
Looking for some guidance on a WCF service I’m prototyping. I have a WCF
Being a self-confessed newbie I'm looking for some advice and guidance :) I have
looking for some help with images referenced within the stylesheet. I have no problems
I'm looking for some general guidance on serializing objects in a database. What are
Hi guys looking for some guidance, i have a knowledge of xhtml, css, javascript,
I'm looking for some guidance on the best way to authenticate to my WebService.

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.