Disclaimer: I am a consultant at Amazon Web Services, and this is my personal blog. The opinions expressed here are solely mine and do not reflect the views of Amazon Web Services (AWS). Any statements made should not be considered official endorsements or statements by AWS.
Let's assume you want to loop through a table variable having the structure like below.
To iterate through this table, just add one more column (Processed
) in this table variable. Now the table should look like this.
Important: Make sure, you have one unique column in the table. If it is
Id
then very good, else create a new one.
After that, use the below SQL.
That's it 😊.