I am trying to run a loop in SQL that loops untill a field is found that equals to something. for example
while exists (select account from #nodes where account IS NOT EQUAL TO 'STRATERGY')
But I dont know how to do this, I want it to loop untill it finds the word STRATERGY in one of the fields in the account column.
Can Anyone lend a hand?
Thanks
From your query I am assuming you have to do some actions on each account which is equal to ‘STRATERGY’. If so use a cursor instead of loop.
If I my assumption is wrong please check this
something like this.