x

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, 2010 at 04:44 PM in Default

avatar image

anthonyk
78 4 4 8

(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, 2010 at 07:36 PM

avatar image

Scot Hauder
6.4k 13 16 22

Scot congrats for 3K!

Nov 18, 2010 at 08:39 PM Cyborg

Thanks, and you on 4K

Nov 18, 2010 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

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x46
x21

asked: Nov 18, 2010 at 04:44 PM

Seen: 1582 times

Last Updated: Nov 18, 2010 at 04:44 PM

Copyright 2016 Redgate Software. Privacy Policy