I have several data validation rules i would like to apply to a stored procedure.
For example
If (select count(*) from table where (namel is not null or namel <> '') and (namef is null or namef = '')) >= 1 Then Begin Print 'First Name is Missing' End Else Begin Select * from table End
This works fine but only applies to 1 validation rule. I've attempted to use nested If statements but this lead to code duplication that i would like to avoid. Any help is appreciated.