I have gone over few articles and samples on the web and learned something about locking a table and it types. However, not sure why I cannot find a solid answer on how to unlock a table.
my assumption was that unlock must be the answer but it doesn't work in sql server (I'm using 2008 R2). so far I have locked a table (exclusively since need to avoid any read/write on table):
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
SELECT 1 FROM test WITH (tablockx)
eventually I had to kill the server process id after finding process id with kill command. now, question is what is the best and graceful to exit from lock state?