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.
Grouping Dates Into Buckets With DATE_BUCKET
DATE_BUCKET groups timestamps into hourly, weekly, and custom intervals, with an origin that determines where every boundary lands.
SQL SERVER – UDF – User Defined Function – Get Number of Days in Month
A simple user defined function that returns the number of days in month for any date, with the leap year rule for February built in.
SQL SERVER – Find Monday of the Current Week
Find Monday of the current week with one line of T-SQL: DATEADD and DATEDIFF with the week part and GETDATE() give you the date.







