When SQL Server executes (and compiles) queries, it acquires table-level locks as the first step. Depend on the query, it could be intent, full or schema-level lock. SQL Server gets object_id for the table and checks if lock can be acquired (e.g. there is no other incompatible locks (lock structures) held for this table).

