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
Gouache painting: at a grain stall a small tin cup overflows with tiny red lentils, spilling a heap onto the counter

DATEDIFF_BIG: Count Long Intervals Without int Overflow

November 29, 2009
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Scripts

DATEDIFF_BIG returns bigint boundary counts. Compare a long seconds interval, reversed dates and a tiny boundary crossing without overflowing int.

Read More
Gouache painting: a narrow wooden spice rack with exactly four small round slots stands on a kitchen counter, all four slots filled with matching small glass jars

smallmoney: Four Fractional Digits Need a Contract

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

smallmoney stores a bounded numeric amount with four fractional digits. These explicit conversions show retained and changed digits without making a financial storage recommendation.

Read More
Gouache painting: on a sewing table, a slate blue felt rectangle and a cream felt rectangle were overlapped by half and pinned

geometry STSymDifference: Keep the Parts Outside the Overlap

November 11, 2009
Pinal Dave
SQL Tips and Tricks
Spatial Database, SQL Function, SQL Scripts, SQL Server

geometry STSymDifference keeps points belonging to either input while excluding their shared portion. I use it when both sides’ exclusive regions matter. Directed subtraction would answer a different question about only one side.

Read More
Gouache painting: a row of four pear trees in an orchard

FIRST_VALUE IGNORE NULLS: Find the First Available Value

November 2, 2009
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Server, SQL Server 2022

FIRST_VALUE IGNORE NULLS selects the first present value through the current row. Preserve source rows and distinguish first from latest.

Read More
Gouache painting: a thick ring of clay hangs level from a single cord, attached to a thin wire cross that spans the ring's open center

geometry STCentroid: The Geometric Center Is Not an Interior Promise

October 30, 2009
Pinal Dave
SQL Tips and Tricks
Spatial Database, SQL Function, SQL Scripts, SQL Server

geometry STCentroid returns a polygon’s geometric center, but that point is not a promise of interior placement. I keep the center calculation separate from an interior test. A holed region makes that distinction visible.

Read More
Gouache painting: two identical engine sheds stand side by side in a railway yard

AsGml: Export a Shape as Namespaced XML

October 24, 2009
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Scripts

AsGml exports geometry as XML in the GML namespace. Read a line’s coordinates with a qualified path and compare an unqualified path.

Read More
A shop door at dusk with the shutter half down and a blank red board hanging beside it

Adding Business Hours to a Timestamp in T-SQL

October 17, 2009
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL Server

Add business hours through a stored work calendar, skip closed dates and nights, and calculate ticket deadlines without a minute loop.

Read More
Previous 1 … 53 54 55 56 57 58 59 … 92 Next
  • Books
  • Testimonials
  • Privacy Policy

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