To find a leap year in SQL Server, ask EOMONTH for the last day of February. I tested the method against the divisibility rule for every year from 1 to 9999 and found no disagreement. The post also shows an inline function, the errors for invalid years and a one-line TRY_CONVERT test.
Detect a Leap Year in T-SQL: Four Simple Ways
Detecting a Leap Year in T-SQL takes one rule or one date trick. This post tests four ways on SQL Server 2025: the calendar rule, EOMONTH, TRY_CONVERT and DATEDIFF. It shows that all four agree on 209 years, explains the century years that trip people up, and answers how leap years affect date math.
SQL SERVER – Identifying Guest User using Policy Based Management
Can a policy catch a guest user left enabled in user databases? Here is a quick tutorial on identifying guest user access with Policy Based Management.
Moving Data Out of SQL Server in Open Formats
Move SQL Server data into open formats such as CSV, JSON, and Parquet while preserving types, NULLs, encoding, and readable files.
SQL SERVER – A Cool Trick – Restoring the Default SQL Server Management Studio – SSMS
Closed Object Explorer by mistake or moved windows around? Here is a cool trick for restoring the default SQL Server Management Studio window layout.
SQL SERVER – Detecting guest User Permissions – guest User Access Status
Is the guest user enabled or disabled, and what is the default? I answer reader questions and show ways to detect guest user access status.
Declare and Initialize Variables in SQL Server: SQL in Sixty Seconds #003
To declare and initialize variables in one statement, give each variable a type and a starting value in the same DECLARE. The tests here show the NULL default, a loop that does not reset an uninitialized variable, and the one character varchar trap on SQL Server 2025.
SQL SERVER – Disable Guest Account – Serious Security Issue
I like to disable guest account access in SQL Server unless there is a real need for it. Here is why the guest user can be a serious security issue.










