How to create a temp table from xml data

  • Hi Everybody,

    I need help from any of u guys. I get 2 parameters to a stored procedure . The first parameter is a xml datatype and the second parameter is a string. I need a stored procedure which creates a temp table or a table variable with the same name of the second parameter and witht he same structrue of the xml datatype. The xml datatype which i get i nothing but a datatable in .net converted into xml and then passed as a parameter to stored procedure.

    Thanks & Regards,

    Naveen kumar

    Who is wise? He that learns from everyone. Who is powerful? He that governs his passions. Who is rich? He that is content. Who is that? Nobody.:)

  • could you show a sample xml document and the output you are looking for? why do you need a table or table variable with a specific name?

    .

  • Hi,

    I also would like to be able to do that. Having a SP:

    CREATE PROCEDURE CreateTable(

    @Name VARCHAR(20), -- the name of the table

    @data XML) -- defines structure of the table and the data to add (includes schema)

    AS BEGIN

    -- ...

    Regards,

    OH

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

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