nolock

Is the NOLOCK (Sql Server hint) bad practice?

烂漫一生 提交于 2019-11-26 01:46:54
问题 I\'m in the business of making website and applications 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 Sql Administrator that I should use NOLOCK if I\'m happy with a \"dirty read\" which will give me a bit more performance out of my system because each read doesn\'t lock

Is the NOLOCK (Sql Server hint) bad practice?

主宰稳场 提交于 2019-11-26 01:02:06
I'm in the business of making website and applications 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 Sql Administrator that I should use NOLOCK if I'm happy with a "dirty read" which will give me a bit more performance out of my system because each read doesn't lock the table/row/whatever. I was also told that it's a great solution if I'm experiencing dead-locks. So, I

What is “with (nolock)” in SQL Server?

风格不统一 提交于 2019-11-26 00:24:33
问题 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? 回答1: WITH (NOLOCK) is the equivalent of using READ UNCOMMITED as a transaction isolation level. So, you stand the risk of reading an uncommitted row that is subsequently