STConvexHull encloses a geometry with its smallest convex hull. Compare a concave polygon, a collinear line and a point using area and membership.
SQL SERVER – Explanation and Understanding NOT NULL Constraint
What a NOT NULL constraint does and two ways to add one: when the table is created, or after the table is created. My example covers both.
SQL SERVER – Three Rules to Use UNION
The three rules to use UNION from Ben Forta’s T-SQL book: two or more SELECT statements, the same columns in the same order, and compatible data types.
Describe a Result Set Without Executing Its Query
Describe a result set without running the query. Check column names, data types, nullability and declared parameters.
SQL SERVER – Pre-Code Review Tips – Tips For Enforcing Coding Standards
Pre-code review tips for DBAs: why I check stored procedures on our development server every day for coding standards, with a link to my full article.
SQL SERVER – T-SQL Script to Add Clustered Primary Key
A Jr. DBA asked me three times in one day how to create a clustered primary key, so I gave him this ALTER TABLE example. He never asked again.
Multiset Difference: Remove Only Matching Duplicate Occurrences
Multiset difference removes matching occurrences while keeping any extra copies from the left input. I assign occurrence numbers before pairing rows. A value’s presence on the right should not automatically remove every left copy.







