I want to run an update based on whether a condition exists. To get the condition I run a query written like
IF Exists (select 1 from Table a join Table b on a.id = b.id)
Update Table A
The select query returns 300 or so results as 1, is there a better practice so the condition is met before all 300 results are retrieved...maybe something more efficient to kick off the update once the very first record is found? Or is it already? Thanks
IF Exists (select 1 from Table a join Table b on a.id = b.id)
Update Table A
The select query returns 300 or so results as 1, is there a better practice so the condition is met before all 300 results are retrieved...maybe something more efficient to kick off the update once the very first record is found? Or is it already? Thanks