This month's discount Comprehensive Database Performance Health Check · Testimonials
SQLAuthority with Pinal Dave
Home
  • Consulting
    • Health Check
  • Free Videos
  • All Articles
    • AI
    • SQL Performance
    • SQL Tips and Tricks
    • Interview Questions and Answers
    • SQL Puzzle
    • SQL Video
    • SQLAuthority News
    • Personal
  • Books
  • Consulting
Two stepping-stone paths begin on different stones

Interview Question of the Week #036 – What is the difference between @@DATEFIRST and SET DATEFIRST?

September 13, 2015
Pinal Dave
SQL Interview Questions and Answers
SQL DateTime

Compare @@DATEFIRST and SET DATEFIRST, test weekday numbering and week boundaries, and make session rules explicit in SQL reports.

Read More
SQL SERVER - Puzzle - Inside Working of Datatype smalldatetime

SQL SERVER – Puzzle – Inside Working of Datatype smalldatetime

July 31, 2015
Pinal Dave
SQL Puzzle
SQL DateTime

A developer got odd results when casting strings sent from an app. This puzzle looks at how the smalldatetime datatype works inside SQL Server.

Read More
Wooden jigsaw puzzle with scattered pieces on a table, a SQL Server puzzle

SQL SERVER – Puzzle with Year Function

June 9, 2015
Pinal Dave
SQL Puzzle
SQL DateTime, SQL Scripts, SQL Server

After my MONTH() contest, here is a puzzle with YEAR function: what do MONTH and YEAR return for the date 0001-1-1, and why? Take a guess first.

Read More
A row of small bud vases with flowers in seasonal order, a hand moving a red poppy into its place.

MONTH, DATEPART and DATENAME: Getting Month Names and Numbers Right

May 20, 2015
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Group By, SQL Server

Use DATENAME for month labels, compare MONTH and DATEPART, control language and culture, and group sales without combining different years.

Read More
Gouache painting: an empty wooden picture frame hanging on a plain wall with a faded sepia landscape painting already inside it, and one vermilion bookmark ribbon draped over the top edge

SQL SERVER – Quiz on knowing DATEPART and DATENAME Behaviors

April 1, 2015
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts

DATEPART and DATENAME accept a string that holds only a time and fill in the missing date as January 1, 1900. This post keeps the quiz, runs every query on SQL Server 2025 and explains which of the five bonus queries work and why.

Read More
SQL SERVER - Trivia - Days in a Year

SQL SERVER – Trivia – Days in a Year

March 21, 2015
Pinal Dave
SQL Puzzle
SQL DateTime

A friend was asked in an interview how to find the days in a year efficiently. Here are the T-SQL methods I tried, plus a small quiz for you.

Read More
SQL SERVER - Interesting Function AGENT_DATETIME

SQL SERVER – Interesting Function AGENT_DATETIME

March 13, 2015
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function

AGENT_DATETIME in msdb converts integer date and time values in YYYYMMDD and HHMMSS format into a datetime. Here is how it works, with examples.

Read More
Previous 1 … 7 8 9 10 11 12 13 … 29 Next
  • Books
  • Testimonials
  • Privacy Policy

© 2006 – 2026 All rights reserved. pinal @ SQLAuthority.com