I'm using a while loop to build a SQL insert string based on values in nodes of an XML object. Here is an example of what I'm attempting to do:SET @SQL = 'insert into dbo.stuff select 'WHILE @i < 10BEGIN @i = @i + 1 @SQL = @SQL + @xml.value('/stuff/item' + @i ,'varchar(50)') + ', 'ENDThis however, is incorrect because the xml.value method only accepts string literals as parameters. Can any one think of a more clever way to accomplish this task? Thanks immeasurably.