About 72,200 results
Open links in new tab
  1. Truncating a table with a foreign key constraint - SQL Server

    Sep 29, 2018 · Doesn’t matter if the table is empty. You need to either drop and re-create the foreign key constraint or just perform a delete instead of a truncate. How often are you really …

  2. sql server - Truncate with where clause - Database Administrators …

    Apr 12, 2017 · Can I use truncate command with a where clause? I need to remove specific rows from several tables. How can I delete specific data from the entire database? SELECT …

  3. sql server - DELETE vs TRUNCATE - Database Administrators Stack …

    Dec 13, 2012 · Truncate requires "alter table" permission (in the sense that truncate is plug in replacement for delete).

  4. sql server - Truncate tables with dependent foreign key constraints ...

    You cannot truncate a table that has foreign key constraints. I would script your truncate statement to drop the constraints, then truncate the table, and then re-create the constraints.

  5. t sql - Rolling back truncate table - Database Administrators Stack ...

    Nov 26, 2019 · I have a stored procedure that does the following: BEGIN TRANSACTION -- Code to delete updated records from production (dbo) table DELETE FROM [dbo].[factMyTable] …

  6. Reuse of space after TRUNCATE TABLE by other tables

    Sep 19, 2023 · If I do truncate my table, will the growth of other tables re-use that space freed up, and hence save disk space in the long term? The reason I ask that is that it would be good if …

  7. sql server - Methods of speeding up a huge DELETE FROM …

    Using SQL Server 2005. I am performing a huge DELETE FROM with no where clauses. It's basically equivalent to a TRUNCATE TABLE statement - except I'm not allowed to use …

  8. What can cause TRUNCATE TABLE to take a really long time?

    Using TRUNCATE TABLE on an InnoDB table requires a full table lock because TRUNCATE TABLE is DDL (Data Definition Language) not DML (Data Manipulation). Doing DELETE …

  9. sql server - SQL Permission to Truncate Table - Database …

    Feb 28, 2018 · How Do I give permission for user to Truncate all tables in database? The minimum permission required is 'ALTER on table_name' per articles below. With this, how do I …

  10. sql server - What permissions are necessary for truncating a table ...

    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.