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.
Finding the Nearest Store With the geography Type
Find the nearest store with SQL Server geography, validate coordinate order, apply a distance radius, and inspect spatial index use.
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.
Synchronizing Data Between Two Databases
Synchronizing data between two SQL Server databases requires a latency target, change source, conflict rule, and recovery plan before tool selection.
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.
Random Tokens in SQL Server: Generation, Storage and Expiry Checks
Random tokens in SQL Server need more than a generated value. Their stored state must define expiry, revocation and whether consumption already occurred. A guarded disposable fixture makes the boundary conditions explicit.







