• Hugo Kornelis (3/21/2013)


    (My original reply was much longer, but I lost it due to that stupid SQLServerCentral bug that tends to eat a reply when you worked on it for a long time. And I had forgotten to copy/paste it somewhere safe first. I don't feel like reconstructing that long reply, so here's the abridged version)

    Stuart Davies (3/21/2013)


    Thanks for the question - good reminder of the basics.

    It appears that quite a few here needed reminding of the differences - 40% wrong at the moment.

    I'm not at all surprised. The percentages for the identity and trigger subquestions show that almost everyone had them right; the problem is in the DDL/DML part. And rightly so.

    The only reason I got points for this question is that I realized that if the author had considered truncate to be DML, *two* extra options would have been right. And the question texts said to check 3 answers, not 4. But I do disagree with this answer, and I do disagree with the parts in Books Online that describe trunacte table as DDL.

    DDL is language that describes data structures. Truncate table does not in any way change the schema of a table. It only removes all data from a table and (for tables with an identity column) resets the "next value" (not the original seed or the increment) of the identity property.

    DML is language that inserted, updates, or deletes data. That (deleting data) is exactly what TRUNCATE TABLE does!

    +1

    I disagree that truncate is a DDL command as well.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events