Filtering on dates without losing an index means using searchable ranges; learn half-open boundaries, date and datetime differences, and plan checks.
DATEPART tzoffset: Read the Signed Offset in Minutes
DATEPART tzoffset extracts an offset in minutes. Preserve its sign, test sub-hour values and retain the source temporal type.
SQL SERVER – UDF to Return a Calendar for Any Date for Any Year
Reader Dan Golden built on my weekly calendar function to create a UDF to return a calendar for any date for any year. I fixed a small first and last week bug.
SQL SERVER – Execute Same Query and Statement Multiple Times Using Command GO
Need to run the same statement several times without copy and paste? Put a number after the command GO, like GO 5, and SQL Server runs the batch that many times.
SQL SERVER – 2008 – New DataTypes DATE and TIME
SQL Server 2008 adds separate DATE and TIME datatypes, something DBAs wanted for years. I compare them with the SQL Server 2005 way of using DATETIME.
Handling Time Zones in SQL Server
Handling time zones in SQL Server means storing an instant, converting with AT TIME ZONE, and testing daylight saving gaps.
SQL SERVER – Introduction and Example for DATEFORMAT Command
I found DATEFORMAT in a Jr. DBA’s code. SET DATEFORMAT sets the order of month, day and year so SQL Server can read date strings in other formats.







