कुछ इस तरह?
DECLARE @XmlVariable XML = '<parent_node>
<category>Low</category>
<category>Medium</category>
<category>High</category>
</parent_node>'
INSERT INTO dbo.YourTargetTable(CategoryColumn)
SELECT
XTbl.Cats.value('.', 'varchar(50)')
FROM
@XmlVariable.nodes('/parent_node/category') AS XTbl(Cats)
अपडेट करें: अगर आपको जरूरी पुरानी विरासत संग्रहीत प्रक्रिया का उपयोग करें और इसे बदल नहीं सकते (यह ऐसा करने का मेरा पसंदीदा तरीका होगा), तो आपको पंक्ति-दर-एगोनाइजिंग-पंक्ति (आरबीएआर) स्वयं को लूप करना होगा, उदा। तालिका चर का उपयोग करके:
-- declare temporary work table
DECLARE @RbarTable TABLE (CategoryName VARCHAR(50))
-- insert values into temporary work table
INSERT INTO @RbarTable(CategoryName)
SELECT
XTbl.Cats.value('.', 'varchar(50)')
FROM
@XmlVariable.nodes('/parent_node/category') AS XTbl(Cats)
-- declare a single category
DECLARE @CategoryNameToBeInserted VARCHAR(50)
-- get the first category
SELECT TOP 1 @CategoryNameToBeInserted = CategoryName FROM @RbarTable
-- as long as we have data
WHILE @CategoryNameToBeInserted IS NOT NULL
BEGIN
-- execute your stored procedure here.....
EXEC sp_executesql N'dbo.YourStoredProcedure @CategoryName',
N'@CategoryName VARCHAR(50)',
@CategoryName = @CategoryNameToBeInserted
-- delete the category we just inserted from the temporary work table
DELETE FROM @RbarTable WHERE CategoryName = @CategoryNameToBeInserted
-- see if we still have more categories to insert
SET @CategoryNameToBeInserted = NULL
SELECT TOP 1 @CategoryNameToBeInserted = CategoryName FROM @RbarTable ORDER BY CategoryName
END