I’m inserting rows into a table from other tables in the SQL Server management Studio and some records violates a unique constraint because initial data is ‘dirty’ and is inconsistent.
How can I find which records violate?
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.
Unfortunately your only solution is to validate the constrain with a query against the source data to find the culprits. If you’d use something like SSIS you could configure it to skip over the rows that violated the constraint(s).