Part 4 on reading the previous row and next row value in a SELECT statement. My friend Szymon Wojcik shows how a numbers table can make the query even faster.
SQL SERVER – How to Access the Previous Row and Next Row value in SELECT statement? – Part 3
My part 2 solution used ROW_NUMBER, which SQL Server 2000 does not have. Here is how to access the previous row and next row in SQL Server 2000.
SQL SERVER – How to Access the Previous Row and Next Row value in SELECT statement? – Part 2
No CTE in your SQL Server 2005 code? Here is another way to get the previous row and next row value in a SELECT statement, using ROW_NUMBER.
SQL SERVER – How to Access the Previous Row and Next Row value in SELECT statement?
How do you access the previous row and next row value in a SELECT statement? In SQL Server 2012 the LEAD and LAG analytic functions make it simple.
Vector Search in SQL Server 2025 With VECTOR_DISTANCE
Use VECTOR_DISTANCE in SQL Server 2025 to rank small example vectors, compare cosine and euclidean distance, and plan larger searches.
Escaping Wildcards in LIKE: Searching for % and _ Literally
Handle escaping wildcards in SQL Server LIKE searches with brackets, ESCAPE, and a reusable function that preserves literal input.
SQL SERVER – A Quick Note on CONCAT_NULL_YIELDS_NULL
A friend ran SET CONCAT_NULL_YIELDS_NULL OFF above every script to deal with NULL columns. Here is a quick note on what it does and what I think of it.






