Top "For-xml-path" questions

"FOR XML PATH" is a SQL Server query directive to return the rowset as an XML document using "PATH" mode.

Replace “&lt;” and “&gt;” with “<” and “>” in sql server

Hi I am new to for xml I have a query like this SELECT ProjectId, ProjectCode, ProjectName, TechId, -- LocationId, ( …

sql-server for-xml for-xml-path
How do I avoid character encoding when using "FOR XML PATH"?

I'm looking to create a comma-separated list of values from a SQL Server 2005 table, just like in JanetOhara's question. I'm …

xml sql-server-2005 encoding for-xml-path
SQL Server : FOR XML PATH - nesting / grouping

I have data that looks like: OrderID CustomerID ItemID ItemName 10000 1234 111111 Product A 10000 1234 222222 Product B 10000 1234 333333 Product C 20000 5678 111111 Product A 20000 5678 222222 Product B 20000 5678 333333 …

sql-server for-xml-path
FOR XML PATH(''): Escaping "special" characters

This code basically translates characters based on position in one string to the character at the same position in another …

sql-server tsql sql-server-2005 for-xml-path
XML string to DataTable object c# method - advice needed

In ASP.NET application I have a query onto sql database for some data and one part of the data …

c# xml datatable for-xml-path
SQL Server: how to remove last comma after combining rows using XML Path

I found a way to combine multiple row's into one row which is comma separated but now I would like …

sql sql-server for-xml-path
How FOR XML PATH('') works when concatenating rows

How does the FOR XML PATH ('') clause do its work when concatenating rows in SQL Server? I just want …

sql-server tsql for-xml-path
XML declaration with "FOR XML PATH" in SQL Server 2005

Below is a simplified version of a query that I have already created. The query works fine, but I cannot …

sql xml sql-server-2005 for-xml-path
Concatenation of strings by for xml path

Hi! Today I learned for xml path technique to concatenate strings in mssql. Since I've never worked with xml in …

sql sql-server-2008 string-concatenation for-xml-path
How to add an attribute to element-centric FOR XML PATH query

I'm building some HTML to be included in the body of an email and sent using sp_send_dbmail. I'd …

sql-server tsql for-xml-path