About 17,100 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. 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 …

  3. sql server - 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? Yup, which is one reason why SHRINK ing is silly - it's just …

  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. sql server - Truncated 200GB table but disk space not released ...

    Sep 24, 2014 · I have only 2GB left, so I need to remove this history table. This table now is empty but the database disk space not released. And the database file is 320GB.

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

  7. sql server - Is there a way to truncate table that has foreign a key ...

    Apr 15, 2013 · Is there a way to truncate table that has foreign keys ? Delete and reseed can take too long. Is deleting and recreating keys only way ? If so is there a tool that does this ?

  8. sql server - Why use both TRUNCATE and DROP? - Database …

    The point of the truncate is to simply and irrevocably remove everything in the table (some technical specifics based on data store engines may differ slightly) -- skipping heavy logging, etc.

  9. 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 …

  10. sql server - Reset IDENTITY value - Database Administrators Stack …

    18 I have a table with an IDENTITY column. While developing I delete the rows from time to time and add them again. But the IDENTITY values always kept increasing and didn't start from 1 when I …