I have some loop and a condition. If codition is matched then I want to stop or exit from the stored procedure. How to do that?
while @@fetch_status=0
begin
if x=0
'exit stored procedure
end
if you are using Microsoft Sql Server than you can use Return
Statement
while @@fetch_status=0 begin if x=0 return; end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With