>>>I have this SQL syntax and I need to know why they put WITH (UPDLOCK) in this statement. Please help
>>>
>>>
>>>select aa.field_10 from mytable aa WITH (UPDLOCK)
>>>
>>>
>>>Thanks,
>>>Sam
>>
>>From SQL help ..
>>
>>Specifies that update locks are to be taken and held until the transaction completes.
>
>I guess the first statement is taken from a longer procedure. Otherwise why would you use this hint with SELECT-SQL?
I think so.
I've never used that hint though, it may in fact work for the duration of the Select by itself as well meaning there will be no updates during what may be a long Select..Not sure on that.
____________________________________
Don't Tread on Me
Overthrow the federal government NOW!
____________________________________