Yahoo India Web Search

Search results

  1. Sep 6, 2024 · The TRUNCATE TABLE statement in SQL is used to quickly remove all rows from a table, effectively emptying the table. Unlike the DELETE statement, which removes rows one at a time and can be rolled back (depending on the database support for transactions).

  2. Sep 3, 2024 · TRUNCATE TABLE removes all rows from a table, but the table structure and its columns, constraints, indexes, and so on, remain. To remove the table definition in addition to its data, use the DROP TABLE statement.

  3. Feb 20, 2024 · The TRUNCATE TABLE statement allows you to quickly delete all rows from a table without deleting the table itself. When you run TRUNCATE TABLE, SQL Server deallocates all the pages used to store the table data, making it extremely fast. It also resets identity columns to the seed values. Here is the basic syntax:

  4. Sep 26, 2024 · TRUNCATE quickly removes all rows from a set of tables. It has the same effect as an unqualified DELETE on each table, but since it does not actually scan the tables it is faster.

  5. Jan 16, 2023 · The truncate TABLE command is used to delete all data from an existing table. It is a data definition language (DDL) command that removes all rows from a table, but the structure of the table and its columns, constraints, indexes, etc. remain intact.

  6. The minimum permission required is ALTER on table_name. TRUNCATE TABLE permissions default to the table owner, members of the sysadmin fixed server role, and the db_owner and db_ddladmin fixed database roles, and are not transferable. However, you can incorporate the TRUNCATE TABLE statement within a module, such as a stored procedure, and ...