Sql help for in clause and loop - for xml explicit

  • Hi, Sql Guru's

    I am trying to pass multiple casenbrs to a sql Stored proc

    here is the issue

    I would like to pass

    (12345,23456:1,1:'F','I')

    it is nothing but

    Casenbr CtrNbrRepType

    123451F

    234561I

    I would like to loop inside a stored proc to generate the xml, i have already 3 stored proc for retrieving xml explicit.

    First:

    I need to generate header with namespace in xml. and a footer

    now between this header and footer

    I would ,like to loop the records based on report type, i would like to call respective stored proc(i already have 3 procs based on reports)

    i hope some one has done this type of coding in stored procs, as far as i know is to create a cursor and load all the records for the parameters i passed in, then use the cursor to loop and write the xml in memory for further use.

    My point is how to parse the values sent to sql procedure (12345,23456:1,1:'F','I')

    as mentioned above, or does any give me enlightening.

    thank you

    Neel

  • Have you considered sending in the params as an XML doc, then using OpenXML? Great way to avoid parsing.

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

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

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