SQL表锁定问题。 [英] SQL Table Lock problem.
问题描述
我正在使用ERP项目,其中有大约1000名用户,访问表格,进行转换,我们也使用交易的概念为我们的项目。我一直面临着桌面锁的问题,它会等待,然后不会被唤醒。那时我曾经杀过那个进程,但通过杀死它会影响所有交易,插入,删除记录会受到阻碍。
亲切地建议我说什么我应该做什么来避免表锁/应该是什么结构(只是摘要)。
我也试过谷歌但没找到正确的答案/或我无法得到/我没有正确的链接。
请建议我。
I am working with ERP Projects, where there are around 1000 users,accessing tables,doing transction, we are also using the concept of transaction for our projects. I am always facing a problem of Table Lock it's goes into wait and then not wakeup. At that time i used to kill that process,but by killing it's affect all transaction,insert,deletion records get hampered connected with each other.
So kindly suggest me what should i do to avoid table lock/ what should be the structure (just summary).
I have also tried google but not found right answer/or i am unable to get/i have not got right link.
Kindly suggest me.
推荐答案
你可能您的选择上缺少表格提示。
http://www.techrepublic.com/article/using-nolock-and-readpast-table-hints-in-sql-server/6185492 [ ^ ]
使用表格提示,例如NOLOCK
全部选择读取一个由交易锁定的记录并从交易前返回记录值。
从上面的链接语法:
You're probably missing table hints on your selects.
http://www.techrepublic.com/article/using-nolock-and-readpast-table-hints-in-sql-server/6185492[^]
Using table hints such as aNOLOCK
allows a select to read through a record which is lock by a transaction and return the record value from before the transaction.
Syntax from the above link:
SELECT COUNT(*) FROM SalesHistory WITH(NOLOCK)
这篇关于SQL表锁定问题。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!