A cursor is the tool we've got to iterate through records.
You can loop through the results of your query and do whatever you have to do with each record.
I've got to disagree with pritaeas on the sp or triggers part. You use a cursor when you need to handle each record differently, in a specific order where a case won't cover things. Usually they are too expensive (in terms of resources) and don't get the job done as fast as processing bulk data would.

Edited
7 Years Ago
by adam_k

Be a part of the DaniWeb community

We're a friendly, industry-focused community of
1.18 million developers, IT pros, digital marketers,
and technology enthusiasts learning and sharing knowledge.