Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Pete_N
Posting Yak Master
181 Posts |
Posted - 2010-09-20 : 03:06:30
|
| I have been trying to run a while loop to read sextions in xmlWHILE (@TotalErrors > 0)BEGINSELECT CAST(@xmlReport.query('data (Errors/Error/ErrorItem[1]/@errorCode)') AS VARCHAR(MAX)) AS 'errorCode' , CAST(@xmlReport.query('data (Errors/Error/ErrorItem[1]/@errorItemType)') AS VARCHAR(MAX)) AS 'errorItemType' ,SET @TotalErrors = @TotalErrors - 1ENDThis retuns the 1st error. @TotalErrors is the number of errors, what i need to find out is how to doSELECT CAST(@xmlReport.query('data (Errors/Error/ErrorItem[@TotalErrors]/@errorCode)') AS VARCHAR(MAX)) AS 'errorCode' , |
|
|
|
|
|