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
The red arrow indicates the use of the LEAD and LAG window functions.

SQL SERVER – Puzzle to Win Print Book – Write T-SQL Self Join Without Using LEAD and LAG

November 16, 2011
Pinal Dave
SQL Puzzle
SQL Function, SQL Scripts

Win a print book: write a T-SQL self join that simulates LEAD and LAG, so you can learn a SQL Server 2012 feature even on an earlier version.

Read More
Results window in sql server management studio.

SQL SERVER – A Simple Quiz – T-SQL Brain Trick

October 19, 2011
Pinal Dave
SQL Puzzle
SQL Scripts

A T-SQL brain trick: three SELECT statements are separated by lines of underscores, and running one of those lines alone gives Msg 2812. Can you explain why?

Read More
Curved wooden reading nook with books.

Puzzle – Usage of New Index Hints – ForceSeek and ForceScan

September 23, 2011
Pinal Dave
SQL Puzzle
Query Hint, SQL Index, SQL Server

SQL Server Denali adds the FORCESCAN hint next to FORCESEEK. A weekend puzzle on these Index Hints: write a query where each one improves performance.

Read More
disaster

SQL SERVER – DBA Quiz 2011 – All was well few moments before all went wrong – Reasons and Resolutions

September 12, 2011
Pinal Dave
SQL Puzzle

My question in DBA Quiz 2011 comes from a real incident: a query that always worked fine suddenly did not. Share your reasons and resolutions.

Read More
Error dialog explaining why a query does not throw an error.

SQL SERVER – Puzzle Involving NULL – Resolve – Error – Operand data type void type is invalid for sum operator

June 27, 2011
Pinal Dave
SQL Puzzle
SQL NULL, SQL Operator, SQL Scripts, SQL Server

SELECT SUM over a lone NULL throws Msg 8117: Operand data type void type is invalid for sum operator. Here is why it happens and how ISNULL fixes it.

Read More
SQL SERVER - Solution - Generating Zero Without using Any Numbers in T-SQL

SQL SERVER – Solution – Generating Zero Without using Any Numbers in T-SQL

June 21, 2011
Pinal Dave
SQL Puzzle

Madhivanan asked how to get zero without using any numbers in T-SQL. Here are the clever reader answers, from SELECT $ to counting a NULL cast.

Read More
SQL SERVER - Solution - Puzzle - Statistics are not Updated but are Created Once

SQL SERVER – Solution – Puzzle – Statistics are not Updated but are Created Once

June 17, 2011
Pinal Dave
SQL Puzzle
SQL Index, SQL Scripts, SQL Statistics

The solution to my puzzle on why statistics are not updated but are created once after a large insert, even with auto update on, and the fix that worked for me.

Read More
Previous 1 … 14 15 16 17 18 19 20 … 22 Next
  • Books
  • Testimonials
  • Privacy Policy

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