Why do you want to lock an entire table? This is usually a bad thing.
But if you really want to, you can do it like this:
[tt]
SELECT name FROM customers WITH (TABLOCK)
[/tt]
which will lock the table for the duration of the statement. You can find out more in Books Online under "locking, table-level"
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.