Is there a way to limit the number of records in a table for a value of one of the columns?
Say I have a column named BoxID.
I want to limit the number of records in this table that have BoxID = 'ABC' to 2 records.
You could think of this as an Invoice Detail table where I don't want there to be more than 2 records with BoxID of 'ABC'
Would something like this work?
Insert into Table ... Where (Select Count(1) From Table Where BoxID = 'ABC' Group By BoxID) < 2
Is there another approach?
Auguy
Sylvania/Toledo Ohio
Say I have a column named BoxID.
I want to limit the number of records in this table that have BoxID = 'ABC' to 2 records.
You could think of this as an Invoice Detail table where I don't want there to be more than 2 records with BoxID of 'ABC'
Would something like this work?
Insert into Table ... Where (Select Count(1) From Table Where BoxID = 'ABC' Group By BoxID) < 2
Is there another approach?
Auguy
Sylvania/Toledo Ohio