Posted by Hugo Kornelis on 06/10/05 01:03
On 8 Jun 2005 18:39:26 -0700, kjaggi@hotmail.com wrote:
(snip)
>If I simply create a unique constraint on both columns it will not
>allow the FAIL combo or PENDING combo with the same serial which I need
>to allow.
Hi kjaggi,
You could use an indexed view for this. I'm typing this example from the
top of my head, so I might have the syntax wrong!
CREATE VIEW FailedResults WITH SCHEMABINDING
AS SELECT serial
FROM dbo.bstresult
WHERE testresult = 'PASS'
go
CREATE UNIQUE CLUSTERED INDEX ix_FailedResults
ON dbo.FailedResults(serial)
go
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)
[Back to original message]
|