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
Colored ceramic beads in a pale shallow tray beside an empty tray and a separate blue bead.

XQuery distinct-values: Deduplicate Atomic Values, Not Nodes

May 9, 2008
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL Server, SQL XML

XQuery distinct-values removes repeated atomic values rather than selecting representative source nodes. I rebuild a small sorted XML result from repeated text. The example also keeps an empty document in view.

Read More
A curved brass strip over a straight ivory bar between dark wooden end blocks, beside two ochre stones.

ACOS: Check the Cosine Domain Before Calculating Angles

May 4, 2008
Pinal Dave
SQL Tips and Tricks
Mathematical Function, SQL Function, SQL Server

ACOS calculates an angle from a supported cosine ratio. Keep invalid and missing inputs visible while displaying valid radians at a chosen scale.

Read More
Five rectangular ceramic dishes tied with a sage ribbon on a wooden shelf.

PERCENT_RANK Versus CUME_DIST: What Ties Change

May 3, 2008
Pinal Dave
SQL Tips and Tricks
Ranking Functions, SQL Function, SQL Server

PERCENT_RANK versus CUME_DIST answers different ranking questions. Keep peers intact and compare missing scores and singleton groups.

Read More
Gouache painting: a long tan leather strap lies straight across a workbench with two brass studs a short gap apart near its middle

CHARINDEX Start Position: Find the Second Delimiter

April 27, 2008
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL String

CHARINDEX start position finds the next delimiter. Guard a missing first match, preserve NULL, and extract empty fields without negative lengths.

Read More
Gouache painting: seen from above, three furrows lie side by side: one long, one shorter, one long

EOMONTH: Month Ends Are Different From DATEADD Month Clipping

April 21, 2008
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL Server

EOMONTH gives me a month-end date when that is the actual reporting requirement. DATEADD moves a date by a month. These operations can agree for one step and disagree on the next.

Read More
Gouache painting: four identical wooden pizza peels lean against a flour-dusted shelf edge, each steeper than the last

TAN: Keep the Angle Away From Its Undefined Point

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

TAN reads radians and returns float. These safe angles demonstrate sign and magnitude while explaining why a large finite float near ninety degrees is not a meaningful infinity.

Read More
A perforated brass insert in a rectangular wooden tray beside a vermilion wooden piece on a round tray and a sage bowl.

PATINDEX and CHARINDEX: Pattern or Literal Search

April 13, 2008
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL String

PATINDEX and CHARINDEX answer different questions. Compare wildcard patterns with literal searches, preserve NULL, and pin collation for digit ranges.

Read More
Previous 1 … 69 70 71 72 73 74 75 … 92 Next
  • Books
  • Testimonials
  • Privacy Policy

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