Home Forums SQL Server 2012 SQL Server 2012 - T-SQL Check constraint where all records with the same effective date add up to one RE: Check constraint where all records with the same effective date add up to one

  • Have you thought this through?   If you had such a CHECK constraint in place, how would you ever add anything new to the table?   Assuming existing data already added up to 100%, you could only add rows that constituted 100%, because your CHECK constraint would prevent each row that didn't = 100% from being added.   I'm pretty sure that is entirely impractical.   The problem here is that you want a CHECK constraint to apply to a group of rows, and I'm pretty sure there's no way to do that.   Anyone know otherwise, please edumacate me!

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)