Sunday, February 12, 2012

Can I place Lock for some time in a Transaction

Dear all,

I have a transaction performing some oeprations. Can I Lock (UPDLOCK) some table for some time in transaction and then release the lock. Basically if i place the lock on table it remains there for whole transaction duration. What to do if I want to release it explicitly in transaction?

Thanks in advance,
AvneeshI do not understand,
can you please be more specific?|||Lets take an example to be more specific about problem
--------------------
Begin tran
Lock mytab with UPDLOCK
...Do Some operation...
Release lock on mytab
...Do some operation....
Commit tran
--------------------

Is this possible?

If you have some idea then most welcome.

Thanks in advance,
Avneesh

No comments:

Post a Comment