1ALTER PROCEDURE manageImpactItemsList
2 @ImpactXml,
3 @ProductID
4AS
5BEGIN
6 DECLARE @Handle INT;
7
8 EXEC SP_XML_PREPAREDOCUMENT(@Handle OUTPUT, @ImpactXml);
9
10 INSERT INTO ImpactItemsList_tbl(ProductID, ImpactItem, ImpactID, Answer)
11 SELECT X.ImpactItem, X.ImpactID, X.Answer FROM OPENXML(@Handle, '/RT/ITEM', 2)
12 WITH(
13 ImpactItem VARCHAR(50) 'ImpactItem',
14 ImpactID INT 'ImpactID',
15 Answer VARCHAR(100) 'Answer',
16 ) AS X;
17
18 EXEC SP_XML_REMOVEDOCUMENT(@Handle);
19
20 RETURN 'SUCCESS';
21END