I need to set a table lock in Microsoft SQL Server 2008 for the duration of an update process.
The end user has multiple independent applications that utilise the database all from independent vendors.
I have experimented with executing a query incorporating "WITH TABLOCKX" but this results in a hang in one of the other independent applications indicating the lock is applied but not trapped. Attached (query1.jpg) is the result of a query on sys.dm_tran_locks that I run to test for existing locks in order to determine if my process can run.
What I need is a query to apply the locks in a way that is trapped by the other independent applications.