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.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Basics of SQL Server data locking

Author  Topic 

boggyboy
Yak Posting Veteran

57 Posts

Posted - 2012-04-25 : 08:29:25
If I have a Stored Procedure that takes 30+ seconds to return data from a data source, does SQL temporarily prevent writes to the same data source? If so, do those writes queue up? I want to understand how SQL Server 2008 orchestrates reads/writes. Can you direct me to a link? Thanks in Advance!

Nick W Saban

Lumbago
Norsk Yak Master

3271 Posts

Posted - 2012-04-25 : 09:52:09
This is a big question and the short answer is (as with any question): it depends. The index situation on the tables involved is very important, but the number of records read/updated is of course important as well as is the transaction isolation level.

The best advice is to make sure all queries are properly indexed and that transactions are as short as possible. Here are some keywords to google for: "lock escalation", "clustered indexes", "nonclustered indexes", "transaction isolation levels", "update statistics". There are probably more things to consider but these are the ones I could think of at the moment.

- Lumbago
My blog-> http://thefirstsql.com/2011/07/08/how-to-find-gaps-in-identity-columns-at-the-speed-of-light/
Go to Top of Page

boggyboy
Yak Posting Veteran

57 Posts

Posted - 2012-04-26 : 12:13:54
Thank you very much!

Nick W Saban
Go to Top of Page
   

- Advertisement -