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 - Solution - Puzzle - SELECT * vs SELECT COUNT(*)

SQL SERVER – Solution – Puzzle – SELECT * vs SELECT COUNT(*)

June 15, 2011
Pinal Dave
SQL Puzzle
SQL Scripts

The solution to my puzzle on why SELECT * throws an error but SELECT COUNT(*) does not, with the best reader answers and credit to Rob Farley.

Read More
A wooden crate of apples at a market stall beside a small brass hand counter on the counter top.

SQL SERVER – Puzzle – SELECT * vs SELECT COUNT(*)

May 30, 2011
Pinal Dave
SQL Puzzle
SQL Scripts, SQL Server

SELECT * gives an error when run alone, but SELECT COUNT(*) does not. Why? Here is my SELECT * vs SELECT COUNT(*) puzzle from the Bangalore User Group.

Read More
SQL SERVER - Finding Location of Log File when Primary Datafile is Crashed

SQL SERVER – Finding Location of Log File when Primary Datafile is Crashed

April 15, 2011
Pinal Dave
SQL Puzzle
SQL Scripts

Do you need the primary datafile to back up the log after a crash? Vinod Kumar asked, so I tried finding the location of the log file without it.

Read More
A detailed woodworking atelier shows one timber beam worked at two stations with coherent tools and careful joinery.

SQL Server Execution Plan Quiz: One Table, Two Operators

March 15, 2011
Pinal Dave
SQL Puzzle
Execution Plan, SQL Index, SQL Server

One table reference can produce Nested Loops, a Key Lookup and parallel operators in an execution plan. A controlled SQL example makes the work visible and shows why MAXDOP is a ceiling rather than a promise of parallel execution.

Read More
Execution plan with cost metrics.

SQL SERVER – Solution – Challenge – Puzzle – Usage of FAST Hint

December 6, 2010
Pinal Dave
SQL Puzzle
SQL Scripts

The solution to my puzzle on the usage of FAST hint: Brad Schulz shows an AdventureWorks example where the FAST hint really improves performance.

Read More
Shiny golden coins and dollar bills.

SQL SERVER – Puzzle – Error While Converting Money to Decimal

December 5, 2010
Pinal Dave
SQL Puzzle
SQL Datatype, SQL Scripts, SQL Server

The answer to my puzzle on Converting Money to DECIMAL(5,2): why it fails with arithmetic overflow, and why DECIMAL(7,2) works, since precision includes scale.

Read More
SQL SERVER - Challenge - Puzzle - Why does RIGHT JOIN Exists

SQL SERVER – Challenge – Puzzle – Why does RIGHT JOIN Exists

November 28, 2010
Pinal Dave
SQL Puzzle
SQL Scripts

If LEFT JOIN does the same work, the puzzle is why RIGHT JOIN exists at all. Can you show a case where it is truly required? Share your answer.

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

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