Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Data Validation

$
0
0

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. 


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>