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: two chains of equal length are pinned between the same pair of wooden posts

DATETIME2FROMPARTS: Match Fractions to Precision

December 26, 2009
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Server

DATETIME2FROMPARTS constructs a complete typed timestamp. Match fraction units to precision and preserve valid calendar components.

Read More
Gouache painting: from a greenhouse beam hang three iron hooks

XML exist: A Present Boolean Expression Still Exists

December 20, 2009
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Scripts

XML exist tests a nonempty XQuery result. Even false() returns a value, so use a node predicate to test presence and preserve NULL XML input.

Read More
Gouache painting: in a drum room, two cymbal stands stand side by side

JSON_OBJECT: Decide Whether Missing Values Become Null

December 18, 2009
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Server, SQL Server 2022

JSON_OBJECT constructs a typed object payload. Choose null or absent properties deliberately and preserve empty strings as present values.

Read More
Gouache painting: beside the bag on a wooden board lies a second pretzel that is almost whole, missing only a small torn piece from one arm

DATEADD Fractional Numbers: Truncate Before Addition

December 13, 2009
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts

DATEADD fractional numbers are truncated, not rounded. Compare positive and negative day additions while preserving an explicitly typed date input.

Read More
Gouache painting: on a bright gym floor, one central blue mat has four neighbors

geometry STTouches: A Shared Boundary Is Not Interior Overlap

December 10, 2009
Pinal Dave
SQL Tips and Tricks
Spatial Database, SQL Function, SQL Scripts, SQL Server

geometry STTouches tests whether shapes meet without their interiors intersecting. I keep that predicate separate from a general intersection check. Sharing an edge and sharing an area are different spatial relationships.

Read More
Gouache painting: two identical lengths of linen tape lie side by side on a loom bench, each standing for one day

CAST to date: Remove Time Without Moving the Day

December 8, 2009
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Scripts, SQL Server

CAST to date keeps the calendar day from a typed datetime2 value. The example preserves the original time and contrasts actual removal with a display that merely hides it.

Read More
Gouache painting: four raised beds stand in a row along a garden path

LEAD Defaults: Missing Rows Differ From NULL Values

December 7, 2009
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Order By, SQL Server

LEAD defaults handle a missing following row. Keep that boundary separate from a present row containing NULL and choose replacement policy explicitly.

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

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