Hi people.
I'd like to set a check constraint on a table that says, if the count of ON bit fields for a particular ID is greater than one then don't allow the update/insert. i.e. SELECT Count(ID) FROM tableName WHERE bitField = 1 GROUP BY ID HAVING COUNT(*) > 1
should be zero or null
I'm can't seem to find any examples online of this being done. Is it possible to use aggregate functions in constraint syntax and if so does anyone have an example.
Thanks.
I'd like to set a check constraint on a table that says, if the count of ON bit fields for a particular ID is greater than one then don't allow the update/insert. i.e. SELECT Count(ID) FROM tableName WHERE bitField = 1 GROUP BY ID HAVING COUNT(*) > 1
should be zero or null
I'm can't seem to find any examples online of this being done. Is it possible to use aggregate functions in constraint syntax and if so does anyone have an example.
Thanks.