We help IT Professionals succeed at work.

Can most Cursor code be replaced with a where exists structure

brgdotnet asked
As an alternative to using a cursor, can using a where exists clause be used instead. I would like some expert opinions about this.
Watch Question

EE Topic Advisor
Most Valuable Expert 2014
Awarded 2013
yes that could be possible.

but it won't always be so simple, you have asked an very broad question.
Vitor MontalvãoIT Engineer
Distinguished Expert 2017
Not always for sure.
If you have any particular case please share it with us so we can give an assertive answer.
Scott PletcherSenior DBA
Most Valuable Expert 2018
Distinguished Expert 2019
In general, no.  Most often a cursor is not used just to avoid an EXISTS().