Nimble Fungus Nimble Fungus - 6 months ago 15
SQL Question

What is the meaning of FOR XML PATH(' ')?

Whats is the meaning of

FOR XML PATH('')?


What does it represent. As there is no root node to it.

Answer

From MSDN:

If you specify a zero-length string, the wrapping element is not produced.

(' ' fails, so I assume you meant an empty string, not a single space).

This has nothing to do with root elements, that's what root is for. This is only about the wrapping element.

Comments