About 193,000 results
Open links in new tab
  1. sql server - What is the correct way to check and delete temp table ...

    Jan 31, 2023 · DROP TABLE [#MyTempTbl]; What is the correct way to check and delete temp table? The context is a stored procedure invoked by an agent job. I have tried querying the [tempdb]. [sys]. …

  2. Good explanation of cascade (ON DELETE/UPDATE) behavior

    Jun 20, 2013 · 21 SQL:2011 Spec There are five options for ON DELETE and ON UPDATE that can apply to the FOREIGN KEY. These are called <referential actions>, directly from the SQL:2011 spec …

  3. sql server - Delete rows older than x days without locking table ...

    Feb 4, 2021 · 10 we have a quite big MS SQL database with millions of rows. I created a simple script to delete rows older than 1 month, but this seems to lock the table and creates trouble for the …

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

  5. sql server - How to drop multiple tables with common prefix in one ...

    Sep 29, 2016 · I'm using Microsoft SQL Server 2008.My question is:How to drop multiple tables with common prefix in one query? something like that table names: LG_001_01_STLINE, …

  6. sql server - Script to Delete records in multiple table - Database ...

    Apr 18, 2017 · From SQL DELETE Most database management systems allow you to create a foreign key constraint so that if you delete a row in a table, the corresponding rows the related table are also …

  7. sql server - How to improve a delete operation that is running in ...

    Apr 7, 2025 · DELETE FROM #temp WHERE TABLE_ID IN (SELECT TABLE_ID FROM @DeletedIDs) -- DROP TABLE #DeletedIDs SET @RowsDeleted = @@ROWCOUNT; END *TABLE_ID* is the PK …

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

    Dec 13, 2012 · DELETE -> the database engine finds and removes the row from the relevant data pages and all index pages where the row is entered. Thus, the more indexes the longer the delete …

  9. t sql - How does SQL Server process DELETE WHERE EXISTS (SELECT 1 …

    Jan 11, 2021 · The below is a valid TSQL statement. But I want to understand how SQL Server processes it. DELETE A FROM table1 WITH (NOLOCK) WHERE EXISTS ( SELECT 1 FROM table2 …

  10. which log files can be deleted in sql server

    Oct 10, 2021 · My hard drive is filling up. Is it safe to delete SQL Server dump files and error log files? It looks like files in multiple folders can be deleted. Following are the ...