Skip to content
Advertisement

Tag: user-defined-functions

SQL Exit scalar function prematurely

In SQL, you can exit the stored procedure prematurely with RETURN statement. However, when I try to apply the same principle to the scalar function, it returns the error, since function needs to return something. How do I prematurely exit the scalar function the same way RETURN is used in the stored procedure? Thank you. Answer You can’t RAISERROR or

Advertisement