About 2,370,000 results
Open links in new tab
  1. What's the difference between TRUNCATE and DELETE in SQL

    Sep 26, 2008 · Truncate and Delete in SQL are two commands which is used to remove or delete data from table. Though quite basic in nature both Sql commands can create lot of trouble until you are …

  2. sql - Difference between drop table and truncate table? - Stack Overflow

    Sep 25, 2008 · Truncate is a more powerful command that empties a table without logging each row. SQL Server prevents you from truncating a table with foreign keys referencing it, because of the …

  3. Pros & Cons of TRUNCATE vs DELETE FROM - Stack Overflow

    Jul 15, 2010 · In SQL Server, it is possible to rollback a truncate operation if you are inside a transaction and the transaction has not been committed. From a SQL Server perspective, one key difference …

  4. sql server 2008 - ¿Cuál es la diferencia entre TRUNCATE y DELETE ...

    Dec 13, 2016 · TRUNCATE reiniciará el contador para una tabla que contenga una columna IDENTITY. DELETE mantendrá el contador de la tabla para una columna IDENTITY. TRUNCATE es un …

  5. How do you truncate all tables in a database using TSQL?

    Oct 1, 2008 · 13 Truncating all of the tables will only work if you don't have any foreign key relationships between your tables, as SQL Server will not allow you to truncate a table with a foreign key. An …

  6. Truncate multiple tables with one SQL statement

    May 17, 2024 · No, you can only truncate a single table with TRUNCATE command. To truncate multiple tables you can use T-SQL and iterate through table names to truncate each at a time.

  7. How to truncate a foreign key constrained table? - Stack Overflow

    Why doesn't a TRUNCATE on mygroup work? Even though I have ON DELETE CASCADE SET I get: ERROR 1701 (42000): Cannot truncate a table referenced in a foreign key constraint …

  8. What is the command to truncate a SQL Server log file?

    Sep 2, 2008 · I need to empty an LDF file before sending to a colleague. How do I force SQL Server to truncate the log?

  9. TRUNCATE table only if it exists (to avoid errors)

    Aug 19, 2014 · I use this script on multiple sites, but in some instances certain table don't exist because they are not required. How do I only truncate a table in MySQL if only that table exist?

  10. sql - What is the difference between truncate, drop and delete of ...

    Sep 10, 2015 · 0 TRUNCATE The TRUNCATE statement removes all data from a table but leaves the table structure intact. e.g. TRUNCATE TABLE my_table; This statement is much faster than using …