This was my original question:
I am trying to figure out how to enforce EXCLUSIVE table locks in SQL Server. I need to work around uncooperative readers (beyond m
Add a locking hint to your SELECT:
SELECT
SELECT COUNT(*) FROM artist WITH (TABLOCKX)
and put your INSERT into a transaction.
INSERT
If your initial statement is in an explicit transaction, the SELECT will wait for a lock before it processes.