This can be used for data warehouses as well as truncating table with foreign key constraints.
Set-based Constraint Violation Reporting in SQL Server
When you're importing data into an RDBMS in bulk and an exception condition is raised because of a constraint violation, you generally need to fix the problem with the data and try again. The error won't tell you which rows are causing the violation. What if you've thousands of rows to search when it happens? There are solutions, writes William Sisson.
2014-10-16
8,821 reads