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
Sql server result window.

SQL SERVER – Puzzle – Working with functions to Concatenate columns

July 10, 2015
Pinal Dave
SQL Puzzle

A code review puzzle: 15 fields joined with ISNULL on every column. Can you concatenate columns with NULL values in a simpler way using SQL Server functions?

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
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
Gouache painting: a plain cream ribbon unrolled along a short wooden shelf, the ribbon stopping at the shelf edge where one vermilion pin marks the last spot

SQL SERVER – Quiz with DATEADD Function – SQL Puzzle

February 17, 2015
Pinal Dave
SQL Puzzle
SQL DateTime, SQL Function, SQL Scripts, SQL Server

The DATEADD function returns the last day of the month when the day does not exist, so one month after January 31 is February 28. This post keeps the quiz, runs every query on SQL Server 2025 and explains the month rule and the Msg 517 overflow with the real results.

Read More
Select query with divide by zero error.

SQL SERVER – Puzzle – Why Divide by Zero Error

December 29, 2014
Pinal Dave
SQL Puzzle

Why does SELECT 10000/(17/17/17) return a divide by zero error? A new puzzle, similar to my decimal rounding one but with a different approach.

Read More
SQL SERVER - Puzzle - Why Decimal is Rounded Up?

SQL SERVER – Puzzle – Why Decimal is Rounded Up?

December 24, 2014
Pinal Dave
SQL Puzzle
SQL Scripts

Why decimal is rounded up in one script and not in the other when both divide 10000 by 17? Try this holiday puzzle before you read the comments.

Read More
SQL SERVER - Contest Winner - What Next on SQL in Sixty Seconds - Poll Result

SQL SERVER – Contest Winner – What Next on SQL in Sixty Seconds – Poll Result

June 4, 2014
Pinal Dave
SQL Puzzle
SQL Server

The poll for the next SQL in Sixty Seconds videos is closed, and most readers want performance tuning. Here are the results and the contest winner.

Read More
Previous 1 … 4 5 6 7 8 9 10 … 22 Next
  • Books
  • Testimonials
  • Privacy Policy

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