I have been asked to write a stored procedure that is dynamic for updating/inserting.
The logic that I have been asked to apply does not make sense to me.
Here is what I was asked to write.
Just make the SQL script dynamic so that we can check whether the variable is valid before appending it to the condition or insert values. For example, we don’t want to update the DOB if the value coming in is not a valid date or null. Also, user won’t be passing PK as parameter. We need lastname, dob, SSN, Gender as the criteria for checking whether the record exist or not.
To me I see the issue of if I am comparing to see if exists against lastname,dob,ssn,gender then it does not matter what the DOB is I have my stored procedure set to @dob datetime so what it gets it date time.
Any suggesstions or ideas?