How to validate incoming data using stored procedures in real time? can some one explain this ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can, but I think this is a bad idea. Business logic does not belong in a database. It belongs in service code (middle tier of an application). The role of a database is to retrieve and save data, not validate it. At least not in the sense of applying business rules.
Now, you can do ‘validation’ in the database in the sense of check constraints and foreign key validation, but this would not be done in stored procedures. This is native support built into most modern database systems.
So, in my opinion, forget about doing data validation in a stored procedure. As I said, validation doesn’t belong there, and, it’s going to be much slower than putting that logic in a middle tier using C++, C# etc.