Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updlock?
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Miscellaneous
Thread ID:
01229047
Message ID:
01229068
Views:
9
>>>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!
____________________________________
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform