Boy you need to reed up on the relational model and set-theory. Loops don't belong in an RDBMS. (except in VERY exceptional circumstances)
Google or search some of these terms and start reading.
You don't need a trigger or a loop Yuck!
If you can supply more details on structure of your table and sample data, and what you need the result to be I could give you example TSQL code to do it.
Reputation Points: 262
Solved Threads: 68
Veteran Poster
Offline 1,181 posts
since Feb 2005