Answers for "openxml to query xml data in sql table"

SQL
0

open xml file sql server

ALTER PROCEDURE manageImpactItemsList
	@ImpactXml,
    @ProductID
AS
BEGIN
 DECLARE @Handle INT;
    
 EXEC SP_XML_PREPAREDOCUMENT(@Handle OUTPUT, @ImpactXml);
    
 INSERT INTO ImpactItemsList_tbl(ProductID, ImpactItem, ImpactID, Answer)
 SELECT  X.ImpactItem, X.ImpactID, X.Answer FROM OPENXML(@Handle, '/RT/ITEM', 2)
 WITH(
   ImpactItem VARCHAR(50) 'ImpactItem',
   ImpactID INT 'ImpactID',
   Answer VARCHAR(100) 'Answer',
 ) AS X;
    
 EXEC SP_XML_REMOVEDOCUMENT(@Handle);
    
 RETURN 'SUCCESS';
END
Posted by: Guest on October-30-2020

Code answers related to "openxml to query xml data in sql table"

Code answers related to "SQL"

Browse Popular Code Answers by Language