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
Blue and sage bowls with terracotta rim beads beside two smaller cups on a pale tray.

FOR XML PATH: Choose Attributes and Nested Elements With Aliases

April 17, 2009
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL Server, SQL XML

FOR XML PATH interprets column aliases as directions for the output’s attributes and element hierarchy. I use three aliases to shape two rows. The source columns stay ordinary relational values.

Read More
Gouache painting: three stepping stone paths cross a meadow

geometry Line Endpoints: Preserve the Described Direction

April 15, 2009
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Scripts, SQL Server

geometry line endpoints identify the first and last described points. Reversing the same path exchanges them, while a closed line starts and ends together.

Read More
A long blue ribbon with a notched end lies beside a closed walnut box and red cord.

LEFT Boundaries: Zero, Oversized Length and Missing Text

April 7, 2009
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Server, SQL String

LEFT boundaries keep empty prefixes separate from missing values. Eight short Unicode cases expose zero, oversized and missing lengths. A separate invalid request shows why negative lengths need validation.

Read More
Gouache painting: on a kitchen counter one moka pot stands fully assembled from its three parts: base, funnel basket and top chamber

DATEFROMPARTS: Build Dates With Explicit Components

April 5, 2009
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Server

DATEFROMPARTS avoids ambiguous text assembly. Preserve year, month and day inputs while separating missing components from invalid calendar dates.

Read More
Gouache painting: on a wooden floor, two open cloth sacks hold small square bean bags in red, blue, green and gray

EXCEPT: Compare Distinct Sets Including NULL

April 4, 2009
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Scripts

EXCEPT returns distinct left-side rows absent on the right. Compare direction, duplicates and NULL equality using complete small result sets.

Read More
Matching red flower pots at tied heights and a gap in one ranking rack.

RANK vs DENSE_RANK: Keep Poll Ties at the Cutoff

March 27, 2009
Pinal Dave
SQL Tips and Tricks
Ranking Functions, SQL Function, SQL Order By

RANK vs DENSE_RANK gives tied vote totals different cutoff behavior. Keep display ordering separate from the tie criterion and rank each poll independently.

Read More
Gouache painting: on a smith's slate bench, one long iron bar lies between two stone blocks

geometry STEquals: Equal Shapes Can Have Different Text

March 20, 2009
Pinal Dave
SQL Tips and Tricks
Spatial Database, SQL Function, SQL Scripts, SQL Server

geometry STEquals compares the represented point set, which can stay the same when its text representation changes. I separate that question from byte-for-byte text identity. Reversing a line does not necessarily change the places it occupies.

Read More
Previous 1 … 59 60 61 62 63 64 65 … 92 Next
  • Books
  • Testimonials
  • Privacy Policy

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