SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Prevent SQL from locking at the table level


Prevent SQL from locking at the table level

Author
Message
junk.mail291276
junk.mail291276
SSCrazy
SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)SSCrazy (2K reputation)

Group: General Forum Members
Points: 2049 Visits: 120
Hello,

Is there any way to limit SQL to locking only at the row level and never at the table level?

I have an application called RAWA that is parsing a file and writing the data from that file to a table in the database. Meanwhile, an API tries to read data from that same table. The two, however, are completely different sets of data, so there should be no need to block at the table level, only the row level.

Is there a way to force SQL NOT to block at the table level?
Lynn Pettis
Lynn Pettis
SSC Guru
SSC Guru (358K reputation)SSC Guru (358K reputation)SSC Guru (358K reputation)SSC Guru (358K reputation)SSC Guru (358K reputation)SSC Guru (358K reputation)SSC Guru (358K reputation)SSC Guru (358K reputation)

Group: General Forum Members
Points: 358554 Visits: 41695
No.

You need to figure out how to improve your application so that you aren't looking for a kludge on the SQL Server side.

Cool
Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
GilaMonster
GilaMonster
SSC Guru
SSC Guru (847K reputation)SSC Guru (847K reputation)SSC Guru (847K reputation)SSC Guru (847K reputation)SSC Guru (847K reputation)SSC Guru (847K reputation)SSC Guru (847K reputation)SSC Guru (847K reputation)

Group: General Forum Members
Points: 847126 Visits: 48505
Look at the queries, make sure they're efficient. Look at the indexes, make sure that they support the queries
If SQL's locking at the table level then either it can't lock at the other levels (row/page locks disabled), or it's reading the entire table because the query/indexes are inefficient and as a result it locks the entire table.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Mark Cowne
Mark Cowne
SSC-Insane
SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)

Group: General Forum Members
Points: 22387 Visits: 27041
See if this helps

https://support.microsoft.com/en-us/kb/323630

____________________________________________________

Deja View - The strange feeling that somewhere, sometime you've optimised this query before

How to get the best help on a forum

http://www.sqlservercentral.com/articles/Best+Practices/61537




Lynn Pettis
Lynn Pettis
SSC Guru
SSC Guru (358K reputation)SSC Guru (358K reputation)SSC Guru (358K reputation)SSC Guru (358K reputation)SSC Guru (358K reputation)SSC Guru (358K reputation)SSC Guru (358K reputation)SSC Guru (358K reputation)

Group: General Forum Members
Points: 358554 Visits: 41695
Pretty sure this question is directly related to this question.

Cool
Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
frederico_fonseca
frederico_fonseca
SSCertifiable
SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)SSCertifiable (6.7K reputation)

Group: General Forum Members
Points: 6656 Visits: 3444
Pretty sure of that also - and some questions from that were not answered - and eventually the solution is easy but not what the OP wishes to be given.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search