title: How can I block users while I truncate a SQL Table
body: <p>We have a SQL Server 2008R2 Table that tracks incremented unique key values, like transaction numbers, etc. It's like a bad version of sequence objects. There are about 300 of these unique keys in the table. 
  My problem is that the table grows several 100,000 rows every day because it keeps the previously used numbers. 
  My issue is that we have to clean out the table once a week or performance suffers. I want to use a truncate and then kick off the SP to generate the next incremented value for each of the 300 keys. This works with a run time of about 5 minutes, but during this time the system is trying to use the table and throwing errors because there is no data.
  Is there any way to lock the table, preventing user access, truncate and then lift the lock?</p>