i need a stored procedure which will update the error message column on the table based on the condition, if dob is null or greater than current date then error message column should be updated as 'invalid dob' and also based on the id it has to be updated, if the dob is lesser than current date and it is not null, then the error message column should not be updated. I need a update statement for this query, i tried it but it update all the columns without checking the condition. so please provide the solution for this query,Thank you.