Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
boreddy
Posting Yak Master
172 Posts |
Posted - 2011-06-10 : 04:51:35
|
| Hi ExpersIn My database i have table which contains the 70k datathis tables is used for all reports and so many casesshere i have one requirementOne of the case when i try to query from table others will not get the data untill i completed my query(In this case i am using some time select some time updata )is this possible to do by usning the lockThanks In advance |
|
|
lappin
Posting Yak Master
182 Posts |
Posted - 2011-06-10 : 06:00:04
|
| You can query a table without locking it by:Select [yourColumnName] from YourTable with (nolock)But you should check if your table is indexed correctly - this will speed your queries and so minimise locking. How long does your query take to run? |
 |
|
|
ahmeds08
Aged Yak Warrior
737 Posts |
Posted - 2011-06-10 : 07:48:36
|
| 70k is not big...please check for the indexes as lappin said.. |
 |
|
|
boreddy
Posting Yak Master
172 Posts |
Posted - 2011-06-10 : 09:00:28
|
my query is running more than 5 minquote: Originally posted by lappin You can query a table without locking it by:Select [yourColumnName] from YourTable with (nolock)But you should check if your table is indexed correctly - this will speed your queries and so minimise locking. How long does your query take to run?
|
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-06-12 : 04:36:48
|
| seems like you're using transactionAlso using nolock can cause dirty reads------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|