• Create a Temp table with exact structure of the xml

    Open the xml document using sp_xml_preparedocument and then insert the data from xml into the temp table created above.

    Once inserted removed the xml document using sp_xml_removedocument

    exec sp_xml_preparedocument @hDoc OUTPUT, @xmlntextparameter

    INSERT INTO @temptable(columns)

    SELECT * FROM OPENXML(@hDoc, 'CC',2)

    WITH ( Type varchar(10),Exp varchar(10),.....)

    exec sp_xml_removedocument @hDoc