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
SQL SERVER - T-SQL Scripts to Find Maximum between Two Numbers

SQL SERVER – T-SQL Scripts to Find Maximum between Two Numbers

June 26, 2011
Pinal Dave
SQL Tips and Tricks
SQL Scripts

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.

Read More
SQL SERVER - Selecting Domain from Email Address

SQL SERVER – Selecting Domain from Email Address

June 18, 2011
Pinal Dave
SQL Tips and Tricks
SQL Scripts

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.

Read More
SQL SERVER - Solution - Puzzle - Statistics are not Updated but are Created Once

SQL SERVER – Solution – Puzzle – Statistics are not Updated but are Created Once

June 17, 2011
Pinal Dave
SQL Puzzle
SQL Index, SQL Scripts, SQL Statistics

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.

Read More
SQL SERVER - Solution - Puzzle - SELECT * vs SELECT COUNT(*)

SQL SERVER – Solution – Puzzle – SELECT * vs SELECT COUNT(*)

June 15, 2011
Pinal Dave
SQL Puzzle
SQL Scripts

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.

Read More
Two blank upright books stand behind a flat sage-green book topped by a small brass ring.

XQuery Node Order: Compare Source Document Positions

June 13, 2011
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Scripts

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.

Read More
An open wooden case holding a terracotta tile beside blue and pale stones.

geometry STAsBinary: Carry the SRID Beside the WKB

June 12, 2011
Pinal Dave
SQL Tips and Tricks
Spatial Database, SQL Function, SQL Scripts, SQL Server

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.

Read More
Gouache painting: a taut linen thread runs around three wooden pegs set in a board, bending at the second peg into an L-shaped path

geometry STPointN: Read a One-Based Point Position

June 7, 2011
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Scripts, SQL Server

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.

Read More
Previous 1 … 227 228 229 230 231 232 233 … 363 Next
  • Books
  • Testimonials
  • Privacy Policy

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