About 198,000 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. 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 …

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

    8 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. Because …

  5. sql server - Dynamic NVARCHAR (MAX) Being Truncated When …

    Mar 27, 2025 · The @SQL variable in the statement below is always truncated when I "inline" a variable. If I send the variable in and print it does not truncate to 4000, however, I can't bind the sent in …

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

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

  7. sql server - How safe is to use BACKUP LOG WITH TRUNCATE_ONLY ...

    Jan 24, 2019 · As per the title, how much is it safe to use BACKUP LOG db_name WITH TRUNCATE_ONLY in last STEP of any SQL-job execution? Randomly found on google that this …

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

    A millisecond or so. Truncate is O (1) - a pure metadata operation. This is assuming there is no concurrent activity on the table. Truncate will potentially need to wait until existing reads are done to …

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

  10. t sql - SQL Server Insert Into - How to identify the column that is ...

    Jul 10, 2017 · Be aware that this trace flag does not actually work with SQL Server 2016 SP2 as opposed to what is stated in the article. You need at least SQL Server 2016 SP. Would be nice if …