Talk:Truncate (SQL)

Is it really a DDL operation? I thought the whole idea was that it affected data/content and didn't affect metadata/structure. It feels much more like DML to me

Talk:Truncate (SQL)

DDL

Is it really a DDL operation? I thought the whole idea was that it affected data/content and didn't affect metadata/structure. It feels much more like DML to me. Mhkay (talk) 16:36, 17 November 2022 (UTC)Reply


There's something better than "feels" --- it's explicitly documented in "Data manipulation" section in ISO SQL (sql:2011 and sql:2016). 5.178.229.209 (talk) 22:50, 16 May 2023 (UTC)Reply


I strongly agree with Mhkay:
In SQL:2023 it's in the SQL data change statement category according to https://standards.iso.org/iso-iec/9075/-2/ed-6/en/ISO_IEC_9075-2(E)_Foundation.bnf.txt, i.e. a DML statement.
Furthermore, I have been communicating about this with someone who has access to the ISO standard. He states:

TRUNCATE is:

- an "SQL-data change statement" - therefore an "SQL-data statement"

It is not:

- an "SQL-schema statement"

The terms DDL and DML are not used in the SQL standard, but those above are pretty much the equivalents. So it is definitely a DML statement.

So I'm going to change the article.
Troels Arvin (talk) 14:30, 30 December 2024 (UTC)Reply
Just to add weight to Troels' point. Although the ISO SQL standard does not use the term DML it does put TRUNCATE under Chapter 14 Data Manipulation, along with all the other "DML" statements and separate from the Schema Definition statements in Chapter 11. A few, but not all, database vendors have historically chosen to describe TRUNCATE as "data definition" statements because that suited their own agendas. The ISO standard ought to be the basis for a NPOV. Oradium (talk) 14:56, 1 January 2025 (UTC)Reply

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.