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
A hand moving tiny furniture from an old dollhouse into the matching rooms of a new one

Restoring a Sample Database to New Folders With RESTORE FILELISTONLY

December 8, 2010
Pinal Dave
SQL Tips and Tricks
DBA, SQL Backup and Restore, SQL Sample Database, SQL Scripts

Use RESTORE FILELISTONLY to map backup files to local folders, restore a separate sample copy, and verify its data and log paths.

Read More
Gouache painting: in a garden bed, a strawberry mother plant and its two small runner plants, still joined by their green runners, sit together in a shallow wooden crate resting on the soil

hierarchyid IsDescendantOf: A Node Includes Itself

December 7, 2010
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Scripts, SQL Server

hierarchyid IsDescendantOf tests membership in a subtree, including its root. These literal paths keep both compared nodes visible and distinguish self from a strict descendant.

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
Folded deckchairs taken from a tall stack and opened one by one in a long row along the beach.

Unpivoting Columns Into Rows With CROSS APPLY and VALUES

December 2, 2010
Pinal Dave
SQL Tips and Tricks
PIVOT and UNPIVOT, SQL NULL, SQL Scripts, SQL Server

Use CROSS APPLY and VALUES for unpivoting columns, retain nulls deliberately, preserve labels, and turn paired fields into aligned rows.

Read More
Gouache painting: three clarinet cases on a wooden table, one holding a single clarinet, one with two clarinets crammed in, and a larger case lined in deep red

WITHOUT_ARRAY_WRAPPER: Keep JSON Cardinality Explicit

December 1, 2010
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Scripts

WITHOUT_ARRAY_WRAPPER needs a single-row JSON contract. Compare one object with two unwrapped objects and validate the complete generated text.

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 … 241 242 243 244 245 246 247 … 363 Next
  • Books
  • Testimonials
  • Privacy Policy

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