SELECT lock only for inserts I need to get the MAX aggregate of certain field in a transaction. I use this value further inside the transaction. I want to avoid inserts in the entire table from which I'm getting the MAX while the transaction is completed.  

I researched the isolation modes and lock hints available. The closest seems to be TABLOCKX, which is the only one that avoids inserts in the entire table (also updates and selects).

Since I no will be affected by updates or selects in the table I wish to avoid only inserts during the transaction.  This is possible?

UPDATE: The field on wich the MAX is performed is seted only on inserts, thus there's no risk of get stale results for updates.

I'm using SQL Server 2000.
Setting the isolation level to SERIALIZABLE would have the same effect:


  The highest isolation level, serializable, guarantees that a
  transaction will retrieve exactly the same data every time it repeats
  a read operation, but it does this by performing a level of locking
  that is likely to impact other users in multi-user systems.


TABLOCK will suffice, there is no need for TABLOCKX to achieve what you've described so far. If the transaction you mention later updates or inserts to the table then TABLOCKX, if it's just to read for the MAX it's unnecessary and other processes will at least be able to read from the table.

Whether you use the isolation level or TABLOCK hint depends on what proportion of the table you will be scanning to find the MAX aggregate. If you need to touch any significant percentage of the rows TABLOCK is logical. A small percentage and a desire to maintain some degree of concurrency then try SERIALIZABLE. TABLOCK would also eliminate the deadlock risk. 

Both options would achieve your aim of preventing an inconsistent result from the aggregate.