About 1,230,000 results
Open links in new tab
  1. How Stuff and 'For Xml Path' work in SQL Server?

    Jul 4, 2015 · Because you're specifying FOR XML, you'll get a single row containing an XML fragment representing all of the rows. Because you haven't specified a column alias for the …

  2. How Stuff and 'For Xml Path' work in SQL Server? - GeeksforGeeks

    Jul 23, 2025 · In SQL Server, the combined use of the STUFF function and the FOR XML PATH clause is a one of the best combination for string manipulation and XML generation. Together, …

  3. FOR XML PATH clause in SQL Server

    Jul 30, 2019 · As SQL professionals, we often have to deal with XML data in our databases. This article will help you walk through several examples of using ‘FOR XML PATH’ clause in SQL …

  4. Combining grouping, STUFF and FOR XML in a single query

    Sep 27, 2016 · If you want to group items in a SQL query, showing a comma-delimited list of ids for each, generating an XML file is not the obvious place to start - but it should be.

  5. Use PATH Mode with FOR XML - SQL Server | Microsoft Learn

    May 10, 2024 · Learn how to use PATH mode with nested FOR XML queries and the TYPE directive to write less complex queries that return xml type instances.

  6. Explain the workings of STUFF and FOR XML PATH in SQL Server ...

    Mar 21, 2025 · The STUFF and FOR XML PATH combination is a clever workaround for string concatenation in SQL Server. Here’s what happens under the hood: FOR XML PATH (‘’) …

  7. SQL Server String Aggregation Techniques: FOR XML PATH vs

    Nov 4, 2025 · The primary method for this task in SQL Server versions preceding SQL Server 2017 relies on a clever application of FOR XML PATH('') combined with the STUFF function.

  8. A Complete Guide to the SQL Server FOR XML PATH Clause

    Oct 1, 2024 · In this article, you will learn what the SQL FOR XML clause is, how it works, what modes it provides, why FOR XML PATH is the most popular one, and how to use it through …

  9. STUFF and SELECT FOR XML PATH - SQL Server to MySQL …

    In SQL Server, STUFF with SELECT FOR XML PATH statement is widely used to concatenate strings from multiple rows into a single row value. Consider a sample table:

  10. sql - Syntax for STUFF/FOR XML PATH - Stack Overflow

    Jul 28, 2017 · From For XML - SQL Server The FOR XML clause can be used in top-level queries and in sub queries. The top-level FOR XML clause can be used only in the SELECT …