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: 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
Detailed painting of three matching cup-and-teapot pairs, one on a table, one in a wooden tray, and one on a fixed open shelf.

Derived Table, CTE or View: Choose the Scope

November 10, 2009
Pinal Dave
SQL Tips and Tricks
CTE, SQL Scripts, SQL Server, SQL Sub Query

A derived table, CTE and view can express the same grouped result while offering different scopes. Compare complete outputs with duplicates and NULLs, then choose a statement-local expression or a saved definition for the task.

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
Beach towels laid edge to edge on the sand, seen from above, one red towel overlapping its neighbor

Preventing Overlapping Date Ranges in a Table

October 31, 2009
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL DateTime, SQL Server, SQL Transactions, SQL Trigger

Detect overlapping date ranges with joins and window queries, use half-open endpoints, and enforce the rule with a multirow trigger.

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
An electric kettle on a counter beside three different plug adapters, one of them fitted into the wall socket.

Environment Settings in SSIS Projects

October 25, 2009
Pinal Dave
SQL Tips and Tricks
ETL, SQL Server, SQL Server Configuration, SQL Server Security, SSIS

SSIS projects can deploy one package across environments by using project parameters, SSISDB variables, and tested references.

Read More
Previous 1 … 348 349 350 351 352 353 354 … 416 Next
  • Books
  • Testimonials
  • Privacy Policy

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