• Paul White NZ (3/30/2010)


    vk-kirov (2/10/2010)


    In the example above, we will see request_mode = Sch-M (schema modification). This is specific to DDL events.

    Not true. From Books Online - Lock Modes:

    Some data manipulation language (DML) operations, such as table truncation, use Sch-M locks to prevent access to affected tables by concurrent operations.

    So, table truncation is explicitly defined as a DML operation.

    Well, this would not be the first time that there is incorrect documentation out there in MSDN.

    From what I undestand, the schema lock is aquired to for the identity re-seed. So one question is now: do you see the identity seed as part of the data or as part of the DDL? I would consider it DDL.

    Maybe TRUNCATE is just DMODLOMB (Data Manipulation Or Definition Language Or Maybe Both).

    This might be a reason why they have not explicitly specified the type directly in the TRUNCATE topic in MSDN - they might not know for sure either 🙂

    Best Regards,

    Chris Büttner