How to save FORXML result into a text parameter

  • For example:

    declare @AppXML text

    How to save following XML result into @AppXML

    select ApplicationId, Name, Address1, Address2, Phone, Fax

    from application

    FOR XML auto

  • It would be great but you cannot use TEXT as the data type for a variable except when used for INPUT/OUTPUT with a stored procedure, however as for OUTPUT no one has provided a working example and have not seen a way to acomplish.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

  • What are you going to do with that text parameter after you have retrieved it?

    Why not loop through the returned recordset and build up the string in your app and get at the XML that way?

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply