A SQL enthusiast at the airport asked for a simple way to find maximum between two numbers. Here is his clever ABS formula and my CASE version.
SQL SERVER – Selecting Domain from Email Address
A quick T-SQL script to select the domain from email address values with RIGHT, LEN and CHARINDEX, and count how many emails share each domain.
SQL SERVER – Solution – Puzzle – Statistics are not Updated but are Created Once
The solution to my puzzle on why statistics are not updated but are created once after a large insert, even with auto update on, and the fix that worked for me.
SQL SERVER – Solution – Puzzle – SELECT * vs SELECT COUNT(*)
The solution to my puzzle on why SELECT * throws an error but SELECT COUNT(*) does not, with the best reader answers and credit to Rob Farley.
XQuery Node Order: Compare Source Document Positions
XQuery node order compares positions in an XML document, not their text. Source order, alphabetical order and a node compared with itself give different answers.
geometry STAsBinary: Carry the SRID Beside the WKB
geometry STAsBinary exports a geometry as WKB, while reconstruction takes a separate spatial reference identifier. I carry that identifier beside the bytes. Supplying a different identifier creates a differently tagged value from the same exported coordinates.
geometry STPointN: Read a One-Based Point Position
geometry STPointN selects a point from an instance. The example keeps its one-based position visible and returns NULL when the requested position exceeds the line point count.







