This month's discount Comprehensive Database Performance Health Check · Testimonials
SQLAuthority with Pinal Dave
Home
  • Consulting
    • Health Check
  • Free Videos
  • All Articles
    • AI
    • SQL Performance
    • SQL Tips and Tricks
    • Interview Questions and Answers
    • SQL Puzzle
    • SQL Video
    • SQLAuthority News
    • Personal
  • Books
  • Consulting
Cardinal Rules, a three panel cartoon by SQLAuthority. The VP suggests letting the AI run straight into production. The red bird is already typing DELETE FROM and Sam pulls the cable out of the wall. The bird says the WHERE clause was coming eventually.

AI in Production Without a WHERE Clause

October 17, 2026
Pinal Dave
AI
AI, DBA, SQL Delete, SQL Server Security

AI in production without a second pair of eyes is a quick way to lose a table. Cardinal was going to add the WHERE clause. Eventually.

Read More
A sloping egg rack at a market stall, one hand taking the oldest egg from the front, another adding a fresh one.

DELETE TOP With ORDER BY: Removing the Oldest Rows First

May 1, 2024
Pinal Dave
SQL Tips and Tricks
CTE, SQL Delete, SQL Order By, SQL Server, SQL Top

Use DELETE TOP safely through an ordered CTE, preview oldest rows, apply a supporting index, and remove eligible rows in bounded batches.

Read More
Gouache painting of a windowsill with six jars of jam and a vase of wildflowers, one jar vermilion

TRUNCATE TABLE WITH PARTITIONS: Empty One Partition Fast

July 1, 2021
Pinal Dave
SQL Performance
SQL Delete, SQL Scripts, SQL Transactions, Table Partitioning

TRUNCATE TABLE WITH PARTITIONS empties one partition and logs far less than DELETE. See the syntax, the index rule and the limits in SQL Server.

Read More
Gouache painting of a spinning cog, a block tower and a toy barn with a vermilion door on a shelf

DBCC CHECKIDENT: Check and Fix the Next Identity Value

May 17, 2021
Pinal Dave
SQL Tips and Tricks
SQL Delete, SQL Identity, SQL Scripts, SQL Server DBCC

DBCC CHECKIDENT reports the next identity value of a table and can change it. This post runs NORESEED, the no-option form and RESEED on a small demo table. It shows how DELETE and TRUNCATE treat the counter, the duplicate key error from a value that is too low, and who may run the command.

Read More
drop statement

Multi Tables – 1 Drop Statement – SQL in Sixty Seconds #134

October 16, 2020
Pinal Dave
SQL Video
SQL Delete, SQL in Sixty Seconds, SQL Scripts, SQL Server

It was taking time as well as require to write them one at a time. In today’s blog post we will see how we can drop multiple tables with a 1 drop statement. 

Read More
delete

Remove Trigger for Delete – SQL in Sixty Seconds #133

October 13, 2020
Pinal Dave
SQL Video
Output Clause, SQL Delete, SQL in Sixty Seconds, SQL Scripts, SQL Server, SQL Trigger

I am involved in the Comprehensive Database Performance Health Check. Today we will discuss how we can remove triggers for the Delete statement. 

Read More
A basket keeps the cut stems removed from a rose bush

How to Capture Deleted Rows Without Trigger? – Interview Question of the Week #297

October 11, 2020
Pinal Dave
SQL Interview Questions and Answers
SQL Delete, SQL Performance, SQL Scripts, SQL Server, SQL Trigger

Question: How to Capture Deleted Rows Without Trigger?
Answer: I was recently asked by my client during the Comprehensive Database Performance Health Check.

Read More
1 2 3 4 Next
  • Books
  • Testimonials
  • Privacy Policy

© 2006 – 2026 All rights reserved. pinal @ SQLAuthority.com