Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15655

Constraint within primary key - sql server database

$
0
0
Sorry to bother you guys with what I thought would be an easy question but googling isn't returning a solution to me.
I have a table with a primary key and one of the other columns in the table is a box number that has to be unique per PK.
That is, PK = 1 and Box number 1, 2, 3, and PK = 2 and Box number 1, 2, 3 are allowed. PK = 1 and Box number 2, 2 are not allowed.
Is a constraint I want? Trigger? Index? I would think the simpler the better. Thanks.

Viewing all articles
Browse latest Browse all 15655

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>