| Author |
Topic |
|
khufiamalik
Posting Yak Master
120 Posts |
Posted - 2008-12-30 : 06:26:11
|
| can I use with(nolock) statement in Update or Insert query? |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2008-12-30 : 06:28:56
|
| u can use with(nolock) in insert statement where from clause is usedand we can use in joins also |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-12-30 : 06:37:31
|
| but keep in mind that this can result in dirty reads sometimes |
 |
|
|
sakets_2000
Master Smack Fu Yak Hacker
1472 Posts |
Posted - 2008-12-30 : 06:37:46
|
quote: READUNCOMMITTED and NOLOCK cannot be specified for tables modified by insert, update, or delete operations. The SQL Server query optimizer ignores the READUNCOMMITTED and NOLOCK hints in the FROM clause that apply to the target table of an UPDATE or DELETE statement.
|
 |
|
|
Nageswar9
Aged Yak Warrior
600 Posts |
Posted - 2008-12-31 : 03:33:20
|
| NoLock is the default for SELECT operations. It does not apply to INSERT, UPDATE, and DELETE statements. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-12-31 : 04:04:43
|
quote: Originally posted by Nageswar9 NoLock is the default for SELECT operations. It does not apply to INSERT, UPDATE, and DELETE statements.
Nope. Nolock is not the default option unless the isolation level is READ UNCOMMITTED. |
 |
|
|
NeilG
Aged Yak Warrior
530 Posts |
Posted - 2008-12-31 : 04:27:19
|
quote: Originally posted by Nageswar9 NoLock is the default for SELECT operations. It does not apply to INSERT, UPDATE, and DELETE statements.
NOLOCK hint must be specified, otherwise locks are created by default |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-12-31 : 04:31:36
|
quote: Originally posted by NeilG
quote: Originally posted by Nageswar9 NoLock is the default for SELECT operations. It does not apply to INSERT, UPDATE, and DELETE statements.
NOLOCK hint must be specified, otherwise locks are created by default
also depends on your isolation level |
 |
|
|
Nageswar9
Aged Yak Warrior
600 Posts |
Posted - 2008-12-31 : 04:34:15
|
| Ok viaskh and NeilG |
 |
|
|
|