A lot of solutions in t-sql forums are criticized as being procedural rather than set-based, although the solutions look perfectly logical and deliver the correct results. What is the difference between a set-based solution and a procedural solution and why should I care?
I'm putting a bounty on this question for two reasons:
First, bounties are new (to me) and I think it's a cool idea.
Second, while I see some merit in the various answers posted, I would like to see a more thorough treatment of the subject. Differences should be illustrated with code, not analogies, and the performance implications should be spelled out clearly.
I believe this is a huge conceptual issue that newcomers to SQL need to understand and deserve to have explained well.