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
Write Shortest Code Zero.

SQL SERVER – Puzzle – Write a Shortest Code to Produce Zero

August 24, 2017
Pinal Dave
SQL Puzzle
SQL Function, SQL Scripts, SQL Server

A puzzle: write the shortest code that produces zero without numbers, arithmetic, the digit 0 or LEN(). I show one valid answer; can you find another?

Read More
SQL SERVER - Puzzle - Incorrect Results with Decimal

SQL SERVER – Puzzle – Incorrect Results with Decimal

June 28, 2017
Pinal Dave
SQL Puzzle
SQL Datatype, SQL Function, SQL Scripts, SQL Server

A new puzzle: a simple table with price and discount returns Incorrect Results with DECIMAL. Can you work out why without running the code in SSMS?

Read More
SQL SERVER - Why We have Audit Trace in DATA Folder? What are These Files?

SQL SERVER – Why We have Audit Trace in DATA Folder? What are These Files?

May 15, 2017
Pinal Dave
SQL Puzzle
File format, SQL Audit, SQL Scripts, SQL Server

The DATA drive filled up with thousands of audittrace .trc files. Here is why SQL Server writes audit trace files there and how to stop them.

Read More
SQL Server sp_spaceused window.

SQL SERVER – Puzzle – Why does sp_spaceused Show No Values?

February 8, 2017
Pinal Dave
SQL Puzzle
SPARSE Columns, SQL Scripts, SQL Server

Why does sp_spaceused show no values for a table that clearly has rows? It stumped me for 10 minutes. Here is the puzzle, try it before reading on.

Read More
SELECT Cast As Date.

SQL SERVER Puzzle – Conversion with Date Data Types

January 1, 2017
Pinal Dave
SQL Puzzle
SQL DateTime, SQL Scripts, SQL Server

Converting values with CAST can round in ways you don’t expect. A puzzle on Date Data Types: guess the output of each query before you run it.

Read More
SQL SERVER - Puzzle - Change in Date Format with Function

SQL SERVER – Puzzle – Change in Date Format with Function

September 20, 2016
Pinal Dave
SQL Puzzle
SQL DateTime, SQL Function, SQL Scripts, SQL Server

SELECT GETDATE() shows both date and time. A simple Date Format puzzle: show only the date part using a function. How many ways can you find?

Read More
SQL SERVER - Puzzle - Playing with Datetime with Customer Data

SQL SERVER – Puzzle – Playing with Datetime with Customer Data

September 15, 2016
Pinal Dave
SQL Puzzle
SQL DateTime, SQL Scripts, SQL Server

A customer sent me code that converts datetime values stored in his data. This puzzle is about playing with datetime conversions. Guess the output first.

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

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