nolock

Does ReadUncommitted imply NoLock

When writing a SQL statement in SQL Server 2005, does the READUNCOMMITTED query hint imply NOLOCK or do I have to specify it manually too? So is: With (NoLock, ReadUnCommitted) the same as: With (ReadUnCommitted) ...

High volumn site using ADO.NET TransactionScope vs ExecuteCommand on NOLOCK, READ UNCOMMITTED directly?

Just read this interesting article by Omar on his blog Linq to SQL solve Transaction deadlock and Query timeout problem using uncommitted reads and at the end Javed Hasan started arguing with him about his solution to the nolock situation on a high volume site. Here, the problem trying to solve is, from the sql sense we need to use Se...

SQL - when should you use "with (nolock)"

Can someone explain the implications of using "with (nolock)" on queries, when you should/shouldn't use it? For example, if you have a banking application with high transaction rates and a lot of data in certain tables, in what types of queries would nolock be okay? Are there cases when you should always use it/never use it? ...

When is it appropriate to use NOLOCK?

I am having timeout issues and deadlocks from time to time with some long running queries. I'm wondering when is it most appropriate to use NOLOCK and where? Do I use it on the updates & inserts? or reads? ...

In a Data Warehouse scenario is there any disadvantage to using WITH(NOLOCK)

I have a Kimball-style DW (facts and dimensions in star models - no late-arriving facts rows or columns, no columns changing in dimensions except expiry as part of Type 2 slowly changing dimensions) with heavy daily processing to insert and update rows (on new dates) and monthly and daily reporting processes. The fact tables are partiti...

SQL Server - how to set (nolock) hint as a default?

is there some way to tell sql server to use the (nolock) hint or every select in a stored procedure? is pretty tiresome to add it to each an every select.... ...

Is the NOLOCK (Sql Server hint) bad practice?

Hi folks, I'm in the business of making website and applicatins that are not mission critical -> eg. banking software, space flight, intensive care monitoring application, etc. You get the idea. So, with that massive disclaimer, is it bad using the NOLOCK hint in some Sql statement? A number of years ago, it was suggested by a fellow S...

Will SQL Server NOLOCK hint return partially written rows?

First of all I'm not asking if NOLOCK should or should not be used. Let's get past that. I guess the question comes down to how sql server writes data? Is an entire row written at once or does it write it a column at a time? I'm asking because the NOLOCK hint is being considered. A dirty read is fine as long as the entire row is retu...

syntax for nolock in sql

I have seen sql statements using nolock and with(nolock) e.g - select * from table1 nolock where column1 > 10 AND select * from table1 with(nolock) where column1 > 10 Which of the above statements is correct and why? ...

Using NOLOCK Hint in EF4?

We're evaluating EF4 and my DBA says we must use the NOLOCK hint in all our SELECT statements. So I'm looking into how to make this happen when using EF4. I've read the different ideas on how to make this happen in EF4, but all seem like a work around and not sanctioned by Microsoft or EF4. What is the "official Microsoft" response to...

PostgreSQL Equivalent of SQLServer's NoLock Hint

In SQLServer, you can use syntax "(nolock)" to ensure the query doesn't lock the table or isn't blocked by other queries locking the same table. e.g. SELECT * FROM mytable (nolock) WHERE id = blah What's the equivalent syntax in Postgres? I found some documentation on table locking in PG (http://www.postgresql.org/docs/8.1/interactive...

Can I apply NOLOCK with a database-wide setting?

Is there a way to make WITH(NOLOCK) be applied on any SELECT statement run on a particular database? ...

How can I avoid a deadlock between these two SQL statements?

I have two stored procedures running in separate threads, running on SQL Server 2005. One procedure inserts new rows into a set of tables and the other procedure deletes old data from the same set of tables. These procedures are running into a deadlock on the tables DLevel and Model. Here is the schema: Table DFile: Primary Key = D...

TSQL NOLOCK VIEW and Store procedure

In our company we tend to us views and store procedures. We've recently started to implement the NOLOCK statement to alot of our views. i was wondering if applying NOLOCK to a view, it "trickles down" to the store procedure... Say i have a view call viewPartyPackage and view statement was... SELECT PartyPackageID, Name, Created,...

Server-side NOLOCK in SQL Server

I know that in the Oracle DB I can configure a flag, that all select queries running on a specific DB can be run as if the NOLOCK hint was added. Is there something similar in SQL Server? ...

Java Hibernate HQL queries with nolock

Is there a way to run these queries as if I added a (NOLOCK) hint to them? ...

SQL Server NOLOCK and joins

Background: I have a performance-critical query I'd like to run and I don't care about dirty reads. My question is; If I'm using joins, do I have to specify the NOLOCK hint on those as well? For instance; is: SELECT * FROM table 1 a WITH (NOLOCK) INNER JOIN table2 b WITH (NOLOCK) ON a.ID = b.ID Equivilent to: SELECT * FROM table 1 ...

How do you use NOLOCK with TADOQuery and TADOTable?

I have the SQL text "SELECT * FROM TABLE1 WITH (NOLOCK)". Two questions: How do I make my TADOQuery use the NOLOCK hint without having to include that in the SQL text? I have literally thousands of TADOQuery's with their SQL dynamically built, and it would be difficult to add WITH (NOLOCK) to all of them, not to mention I use with wit...