I know this is such a silly question but I tried every bracket I can think of to wrap the IF statement but it seems that none of them work.
For example:
IF(@item!=0){
//Do stub
RETURN // without the brakets , this return does not belong to if
}
//Do some stubs // and if the condition of the IF is false, this statement can't be reached
Thank you
try begin and end instead
IF(@item!=0)
begin
/*Do stub*/
RETURN
/* without the brakets , this return does not belong to if */
end
Instead of RETURN
, you can also use ELSE
:
if @item != 0
begin
-- Do stub
end
else
begin
-- Do some stubs
-- and if the condition of the IF is false, this statement can't be reached
end
Plus:
IF
clause--
instead of //
for comments (see my example)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