Provided the XML comes out in one field (and I believe it does), you could DECLARE a variable and SELECT its value from the SELECT...FOR XML statement. But what if the result is larger than 8K?
-----------
I'm not as think as you confused I am.
-----------
Flabbergasted (a.): Amazed at how much weight one has gained.
-----------
Oyster (n.): One who sprinkles their conversation with Yiddish expressions.
OK, upon further review (and straight from BOL, which you should check out):
<QUOTE>
FOR XML cannot be used in a selection that requires further processing in a stored procedure.
FOR XML cannot be used with cursors.
Generally, FOR XML cannot be used for any selections that do not produce direct output to the Microsoft® SQL Server™ 2000 client.
</QUOTE>
Meaning that you can't process the result in a stored procedure. You have to process it in a client (.NET, VB, whatever) that connects to the SQL instance.
-----------
I'm not as think as you confused I am.
-----------
Flabbergasted (a.): Amazed at how much weight one has gained.
-----------
Oyster (n.): One who sprinkles their conversation with Yiddish expressions.
Read my last post. Then read Books On Line. Any result of SELECT ... FOR XML is UNAVAILABLE for further processing in the SQL memory space. You can't use the result in an SP. You can't pass the result to an SP call as a parameter. You have to call, retrieve, and process the result with a client application like .NET.
Hopefully more internal XML processing will be available with Yukon or the next buzzword project name version of SQL Server. You just can't do it now.
-----------
I'm not as think as you confused I am.
-----------
Flabbergasted (a.): Amazed at how much weight one has gained.
-----------
Oyster (n.): One who sprinkles their conversation with Yiddish expressions.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.