x
login about faq Site discussion (meta-askssc)

Where does APPLOCK_TEST live?

I am looking to perform an APPLOCK_TEST within my .NET program, so I was wondering, what it is and where exactly does it live. By being in all upper case, I suspect it is a function, but I cannot find it. If it is a function then I will have to make an ExecuteScalar call. I don't think it is a stored procedure, so I cannot code calling it like one.

more ▼

asked Nov 18 '10 at 04:44 PM in Default

anthonyk gravatar image

anthonyk
78 3 4 6

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

sp_getapplock and sp_releaseapplock are stored procedures. APPLOCK_TEST should be referenced via a SQL SELECT in a string or placed in a stored proc. eg SELECT APPLOCK_TEST('public', 'yourresource', 'Exclusive', 'Transaction') Preferably in a stored proc because you will have to wrap this in a transaction if the lock_owner is set as Transaction per the example. APPLOCK_TEST is a built-in function so there is nothing to view. You can find the lock info in master.sys.syslockinfo where rsc_type=10

more ▼

answered Nov 18 '10 at 07:36 PM

Scot Hauder gravatar image

Scot Hauder
5.7k 13 15 18

Scot congrats for 3K!

Nov 18 '10 at 08:39 PM Cyborg

Thanks, and you on 4K

Nov 18 '10 at 08:42 PM Scot Hauder
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x31
x18

asked: Nov 18 '10 at 04:44 PM

Seen: 751 times

Last Updated: Nov 18 '10 at 04:44 PM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.