Reply to Re: what type of Constraint to prevent duplicates

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация