Does the order of join in a query change the result? With AdventureWorks, I show two queries that return the same rows, only in a different order.
SQL SERVER – 2008 – Get Current System Date Time
Several ways to get the current system date time in SQL Server 2008, from GETDATE to the newer functions, with a quick video on the topic.
SQL SERVER – 2008 – Find Current System Date Time and Time Offset
SQL Server 2008 adds SYSDATETIMEOFFSET, which returns the current system date time along with its time offset from GMT. One line shows how.
How to Calculate Age Correctly in SQL Server
Calculate Age in SQL Server by counting completed birthdays, not calendar years. This post compares DATEDIFF, a DATEADD correction and a compact integer version on a bike club table, handles February 29 birthdays and ends with a reusable function for age on any date.
SQL SERVER – SQL SERVER – Simple Example of Recursive CTE – Part 2 – MAXRECURSION – Prevent CTE Infinite Loop
Can you stop a recursive CTE from running forever? Yes. Use the MAXRECURSION option to limit it, and see what happens when the limit is too low.
SQL SERVER – Simple Example of Recursive CTE
A simple example of Recursive CTE in SQL Server, using AdventureWorks to walk the hierarchy of managers and employees, with each part explained.
SQL SERVER – mssqlsystemresource – Resource Database
What is mssqlsystemresource? It is the Resource Database, a read only database of system objects that makes upgrading SQL Server much easier.
Pagination With OFFSET and FETCH
OFFSET and FETCH make page-number queries readable, but deep pages scan past prior rows; keyset pagination keeps the next page focused.
NULLIF Denominators: Keep Zero and Missing Values Visible
NULLIF denominators turn zero into NULL for a deliberate division policy. This complete example keeps zero, missing inputs and integer truncation visible beside the decimal result.
SQL SERVER – DBCC SHRINKFILE Takes Long Time to Run
Why does DBCC SHRINKFILE take so long when index rebuilds run faster? It is single threaded. Rebuild indexes first and the shrink takes less time.










