Is there a way to perform data validation using CHECK constraints in t-sql and to show somehow the data which did not pass the check constraint?
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.
Yes, that is what CHECK constraints are for: Implementing data validation that can’t be done through table modelling
No, the only information you will get back from CHECK constraints is an error message when provided data has failed to meet the CHECK constraint requirements. It’s up to you to review the data.
A trigger would be the next likely option, to have the ability to redirect the attempted data to a table for logging.