Voorbeeld gebruik van Return keyword
Return keyword:
Exits unconditionally from a query or procedure. RETURN is
immediate and complete and can be used at any point to exit from a
procedure, batch, or statement block. Statements following RETURN
are not executed.
Voorbeeld:
Declare @userId int ; SELECT @userId = dbo.GetUserID(@login, @password); IF @userID is null Begin PRINT 'Invalid login...' Print @userID Return; END;