A Negative Identity seed lets a column start below zero, and a negative increment makes it count down. This post tests IDENTITY(-1,-1) and IDENTITY(-2147483648,1) on SQL Server 2025, shows gaps after a rollback, DBCC CHECKIDENT, and what to do when an int identity runs out. It also shows SEQUENCE as the flexible alternative.
CROSS APPLY Aggregate: An Empty Input Can Still Return a Row
CROSS APPLY aggregate behavior depends on whether the right-side query actually produces a row. I inspect that query before assuming unmatched customers disappear. An aggregate without GROUP BY can return a row even when its input is empty.
SQL SERVER – Finding the Occurrence of Character in String
A quick T-SQL method using LEN and REPLACE to count the occurrence of character or word in a string, written as a hint for TSQL Beginners Challenge 14.
geometry MakeValid: Repair Can Change the Geometry Type
geometry MakeValid returns a valid geometry from an invalid instance, but the result can change type. I keep the original beside the proposed repair. A validity flag alone does not describe everything that changed.
SQL SERVER – Computed Column and Performance – Part 3
Part 3 of my series on computed column and performance shows how an index improves the performance of a computed column. Read the earlier parts first.
SQL SERVER – SHRINKDATABASE For Every Database in the SQL Server
A query tuning visit turned into a lesson on why running SHRINKDATABASE for every database is a bad idea. Here is what happened at the client’s office.
SQL SERVER – Parallelism Query in Database
Feodor asked how to get a parallelism query plan on a dual core computer using AdventureWorks. Here is the T-SQL I used to reproduce a parallel plan.







