Author name: Rob Mills

A 30+ year database veteran. I enjoy sharing my stories and knowledge with others.

SQL Server TSQL Delete All Table Rows – TRUCATE TABLE vs DELETE ALL

Use the TRUNCATE TABLE command instead of DELETE ALL FROM [table] if you need to remove all records: The TRUNCATE command will, in most cases,take less time than DELETE especially for large tables. WHY? TRUNCATE doesn’t log each deleted row in the transaction log while DELETE does. Rob MillsA 30+ year database veteran. I enjoy …

SQL Server TSQL Delete All Table Rows – TRUCATE TABLE vs DELETE ALL Read More »

Remove Duplicate Rows From SQL Server Table Using PARTITION BY and CTE Query

Often you’ll run into cases where a SQL Server table will contain duplicate rows and you’re tasked with removing them. Here’s one way to do it with a PARTITION BY. I blame the front-end developers when this happens, even if I’m the sole developer of the app. 😊 In the following SQL scripts, we will …

Remove Duplicate Rows From SQL Server Table Using PARTITION BY and CTE Query Read More »

Scroll to Top