• Paul White NZ (4/6/2010)


    Christian Buettner-167247 (4/6/2010)


    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.

    A Sch-M lock is certainly required for a RESEED, but not every table has an IDENTITY column :w00t:

    So, that cannot be the general explanation.

    As the documentation states, the Sch-M lock is used to prevent concurrent access to the table while the operation progresses. The primary purpose of TRUNCATE TABLE is to delete records - clearly a DML. The fact that an Sch-M lock is taken is an implementation detail.

    The quote button is quoting the wrong post...

    @vk-kirov

    The website you linked says:

    Data manipulation language (DML) statements access and manipulate data (my emphasis) in existing schema objects.

    What is TRUNCATE if not a DML statement by that definition? 🙂

    Peter Trast
    Microsoft Certified ...(insert many literal strings here)
    Microsoft Design Architect with Alexander Open Systems