OK, heres my problem, I have a table that uses the following 2 constraints:
CONSTRAINT [UNIT_COMMS_DVC_TYPE_PK] PRIMARY KEY CLUSTERED
(
[UNIT_COMMS_DVC_TYPE_ID]
) ON [PRIMARY]
CONSTRAINT [IX_UNIT_COMMS_DVC_TYPE] UNIQUE NONCLUSTERED
(
[UNIT_ID],
[COMMS_DVC_TYPE_ID]
) ON [PRIMARY]
The problem is that when I use the following sql in an SP:
SELECT DISTINCT UNIT_COMMS_DVC_TYPE_ID,
UNIT_ID, COMMS_DVC_TYPE_ID
WHERE UNIT_ID = @UNIT_ID
it only displays 1 record even though there are 2 that should match, however, when I remove the second constraint from my table both records then show up. Is there something I'm missing here?
Edited by - matthewkane on 05/02/2003 08:46:52 AM