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 - Handling XML Documents - Notes from the Field #125

SQL SERVER – Handling XML Documents – Notes from the Field #125

May 19, 2016
Pinal Dave
SQL Tips and Tricks
Notes from the Field, SQL Server, SQL Server Security, SQL XML

Stuart Ainsworth shares a client case of importing XML documents into a staging table and what he learned about using XQuery methods in SQL Server.

Read More
A cannoli forming tube beside a filled pastry shell and an empty matching shell

Sending an HTML Table by Email With sp_send_dbmail

March 5, 2014
Pinal Dave
SQL Tips and Tricks
Database Mail, HTML, SQL XML

Turn a wall of report text into a clean table. FOR XML PATH escapes your data, and a few small tricks handle NULL values and empty days.

Read More
Three pale ceramic bowls, two filled with blue and terracotta stones and one empty, beside two loose stones.

XQuery Comparisons: General Equality Is Not Singleton Equality

November 22, 2013
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL Server, SQL XML

XQuery Comparisons use different rules for general sequence operators and singleton value operators. I make equality and inequality visible side by side. A general unequal-pair result is not always the inverse of an equal-pair result.

Read More
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
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
SQL SERVER - Grouping by Multiple Columns to Single Column as A String

SQL SERVER – Grouping by Multiple Columns to Single Column as A String

September 14, 2012
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server, SQL XML

How do you group data from multiple columns into one comma separated string per row, grouped by another column? Here is a sample dataset and the query.

Read More
A nutcracker rests beside one walnut kernel and a much larger collection of its cracked shell pieces

Checking XML Index Size Against the Table It Belongs To

August 10, 2012
Pinal Dave
SQL Tips and Tricks
SQL Data Storage, SQL DMV, SQL Index, SQL XML

An XML index can outweigh the table it serves. Here is how I measure each XML structure next to the base table, and what to test before dropping one.

Read More
Previous 1 2 3 4 5 Next
  • Books
  • Testimonials
  • Privacy Policy

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