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 - Group by Rows and Columns using XML PATH - Efficient Concating Trick

SQL SERVER – Group by Rows and Columns using XML PATH – Efficient Concating Trick

April 5, 2013
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server, SQL String, SQL XML

A reader wanted students and courses grouped by course and instructor in a single row. Here is a simple concatenation trick with XML PATH that does it.

Read More
A socket wrench sitting slightly loose on a hex bolt, a nearly identical socket from another set lying beside it

Where T-SQL Differs From the ANSI Standard

March 31, 2013
Pinal Dave
SQL Tips and Tricks
Developer, SQL NULL, SQL Paging, SQL Server, SQL String

See where T-SQL differs from the ANSI standard in row limits, concatenation, NULL behavior, and practical query portability.

Read More
SQL SERVER - Check If String is a Palindrome in Using T-SQL Script - Reverse Function

SQL SERVER – Check If String is a Palindrome in Using T-SQL Script – Reverse Function

March 7, 2013
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL Server, SQL String

A friend building a captcha had to skip words that read the same backward. Here is a T-SQL script with REVERSE to check if a string is a Palindrome.

Read More
Two nearly identical brown leather gloves on a hall table, both for the left hand, a hand hovering above them.

Finding Duplicate Customers With T-SQL

January 6, 2013
Pinal Dave
SQL Tips and Tricks
Duplicate Records, SQL Function, SQL Server, SQL String

Find duplicate customers with T-SQL by normalizing names, reviewing fuzzy matches, and merging records only after ownership is settled.

Read More
A row of wooden toy animals with the repeats set aside in a basket below.

Removing Repeated Characters From a String With GENERATE_SERIES

December 8, 2012
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Server, SQL Server 2022, SQL String

Remove repeated characters with GENERATE_SERIES, ROW_NUMBER, and ordered STRING_AGG, then benchmark a SQL Server 2019 fallback.

Read More
Hands sewing cloth bunting whose cord has run out, two red flags side by side.

STRING_AGG Limits: The 8,000 Byte Error, Ordering and Duplicates

December 1, 2012
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Server, SQL String, SQL XML

Fix STRING_AGG 8,000-byte limits, enforce ordering, remove duplicates before aggregation, and compare its timing with XML.

Read More
Gouache painting of two shelves holding the same three jars in opposite orders, the short jar on the top shelf painted red

Display Datetime in a Specific Format: CONVERT and FORMAT

November 21, 2012
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL String

To display datetime in a specific format, use CONVERT with a style number or FORMAT with a pattern. This post tests both on a fixed value, shows the lowercase pattern mistake, measures how much slower FORMAT is, and explains why parsing text dates needs a style.

Read More
Previous 1 … 8 9 10 11 12 13 14 … 22 Next
  • Books
  • Testimonials
  • Privacy Policy

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