Wednesday, January 21, 2015

Query records without waiting for unlock in SQL server

SQL Table hints specify additional options for query execution.
For a normal query in SQL server the query execution is halted temporarily if a records is being committed which results in significant delay if large number of records are being updated constantly. To avoid this issue, use with (nolock) in the from statement of the query which results in slighly older dataset, but quicker execution

Also, there is a related  table hint READPAST which just ignores the records already in lock state while querying, thus improoving performance.

More information can be found at http://www.techrepublic.com/article/using-nolock-and-readpast-table-hints-in-sql-server/

No comments:

Regex obfuscate email

 Use this code in C# to obfuscate email using regex // Online C# Editor for free // Write, Edit and Run your C# code using C# Online Compile...