About 43,100 results
Open links in new tab
  1. sql server - DROP -> SELECT INTO V.S. TRUNCATE -> INSERT INTO ...

    Jun 2, 2025 · 1- CREATE temp table if it doesn't already exist --> TRUNCATE temp table from previous data before inserting new data --> INSERT the new data into temp table. 2- DROP temp table if it …

  2. Does TRUNCATE TABLE affects isolation level in Sql Server?

    TRUNCATE table will take a SCH-M lock on the table. Even at READ UNCOMMITTED level the SELECT query will need to take a SCH-S lock. This won't be possible until the TRUNCATE …

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

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

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

  6. Truncating and inserting in a safe transaction on MySQL

    I am trying to TRUNCATE and INSERT data into a MySQL InnoDB table. I wanted to make sure that if any statement in the transaction failed, the data will be untouched.

  7. sql server - Table partitioning for CDC enabled table - Database ...

    Dec 11, 2024 · TRUNCATE TABLE schema.tablename WITH (PARTITIONS (22)); Msg 4711, Level 16, State 1, Line 96 Cannot truncate table because it is published for replication or enabled for Change …

  8. sql server - TRUNCATE WITH PARTITION Constantly Fails on 1 Out of …

    Jul 8, 2024 · There is a table that seems to have constant updates. There is also a stored procedure that runs periodically and iterates through tables and attempts to truncate a partition of data using the …

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

  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 …