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
Result column flipping between 1 and 0.

Puzzle – Datatime to DateTime2 Conversation in SQL Server 2017

November 16, 2018
Pinal Dave
SQL Puzzle
SQL DateTime, SQL Scripts, SQL Server, SQL Server 2017

At PASS, SQL Server expert Christopher Savage showed me a puzzle on DateTime to DateTime2 conversion in SQL Server 2017. I still have no answer, so can you solve it?

Read More
Execution plan of a query with a single row and single table.

SQL SERVER – Puzzle – Why Such a Complicated Execution Plan for a Single Row, Single Table Query?

July 13, 2018
Pinal Dave
SQL Puzzle
Execution Plan, SQL Scripts, SQL Server

A simple puzzle: why does SQL Server show such a complicated execution plan for a single row, single table query on WideWorldImporters? Try to solve it.

Read More
Miscellaneous Options In Database Property Options.

SQL SERVER – SSMS 17.7 Observation – Two Miscellaneous Category in Database Property Options

June 12, 2018
Pinal Dave
SQL Puzzle
Bug Fix, SQL Server, SQL Server Management Studio

In SSMS 17.7 the Database Property options page shows two Miscellaneous categories. Why are there two? Here is what I found when I looked closer.

Read More
Year 1904 Answer.

SQL SERVER – Puzzle – How Does YEAR Function Work?

March 13, 2018
Pinal Dave
SQL Puzzle
SQL DateTime, SQL Function, SQL Scripts, SQL Server

SELECT YEAR(35000/20) returns 1904, which looks strange. This puzzle shows how the YEAR function treats a plain integer. Can you explain the result?

Read More
unexpected results

SQL SERVER – Puzzle – SQL Server Stored Procedure and Unexpected Results

March 6, 2018
Pinal Dave
SQL Puzzle
SQL Scripts, SQL Server, SQL Stored Procedure

The matter of the fact when I discovered this puzzle related to the stored procedure and unexpected results, I was very much surprised as well. 

Read More
Incorrect alias in INSERT statement.

SQL SERVER – Puzzle – How Does Table Qualifier Work in INSERT Statement?

March 2, 2018
Pinal Dave
SQL Puzzle
SQL Scripts, SQL Server, SQL Table Operation

You can use a table alias in SELECT just fine, but how does a Table Qualifier work in the column list of an INSERT statement? Try this short puzzle.

Read More
Puzzle.

SQL SERVER – Puzzle – Get the First Name From Full Name Without CHARINDEX

February 21, 2018
Pinal Dave
SQL Puzzle
SQL Function, SQL Scripts, SQL Server, SQL String

A puzzle from a health check: get the first name from full name without CHARINDEX. Here is the sample table and data, so you can try your own answer.

Read More
Previous 1 2 3 4 5 6 … 27 Next
  • Books
  • Testimonials
  • Privacy Policy

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