Open XML

  • How can I send the result set of my store proc to the .net app using open XML, where in my proc result set will be having 2 columns.

    I need some basic code for using EXEC sp_xml_preparedocument for executing my proc and pop up result set for the app.

  • I'm not entirely sure I understand your question, but you might care to look up the

    SELECT.... FOR XML

    syntax. It will output the contents of a select statement as XML, which can then be directly absorbed by any XML-aware .NET app (or - take in the stream of XML and turn it into a file, etc...)

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • any more help pls..

  • I can use FOR XML AUTO for select statements but how can i use for store proc

    Mike Levan (11/5/2007)


    any more help pls..

  • Mike - the result set you're outputting from the stored proc is based on a select somewhere within the SP. If you should simply structure the select statements outputting your "result set", then you're going to get XMl being output by default whenever you run the SP.

    In other words - find the select statement returning the results, and format it to XML using the FOR XML syntax, auto/path/explicit depending on how you want it formatted.

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

Viewing 5 posts - 1 through 4 (of 4 total)

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