About 38,500 results
Open links in new tab
  1. sql server - Truncate with where clause - Database Administrators Stack ...

    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 …

  2. 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).

  3. 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.

  4. 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 just emptying …

  5. 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 FROM …

  6. 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] WHERE …

  7. 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 give permission …

  8. sql server - Methods of speeding up a huge DELETE FROM <table> …

    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 TRUNCATE. The …

  9. sql server - How long will a truncate table take on 252M Rows (170GB ...

    As a TRUNCATE is a DDL (Data Definition Language) operation and not a DML (Data Manipulation Language) operation and only the system tables are part of the transaction, I'm presuming that it …

  10. sql server - Why does truncating a temp table at the end of the stored ...

    Oct 17, 2017 · Truncating a temp table at the end of the stored procedure that creates it seems to cause the space the table uses in tempdb for the data to be released faster than if no truncate statement is …