You are here: Re: Triiger -vs- Constraint « MsSQL Server « IT news, forums, messages
Re: Triiger -vs- Constraint

Posted by Hugo Kornelis on 10/01/13 11:23

On Sat, 6 Aug 2005 21:37:46 +0000 (UTC), Erland Sommarskog wrote:

>Hugo Kornelis (hugo@pe_NO_rFact.in_SPAM_fo) writes:
>> I don't think that matters much. With ANSI_NULLS on, you can index the
>> computed column, but you still can't use it in a FOREIGH KEY constraint.
>
>In SQL 2005 you can:
>
> CREATE TABLE a (a int NOT NULL,
> b AS a + 3 PERSISTED)
> CREATE TABLE c (c int NOT NULL PRIMARY KEY)
> go
> ALTER TABLE a ADD CONSTRAINT fk
> FOREIGN KEY (b) REFERENCES c(c)
> go
> INSERT c (c) VALUES (9)
> INSERT a (a) VALUES (6)
> go
> DROP TABLE a, c

Hi Erland,

Thanks. I can't wait until SQL Server 2005 is released, and I can
finally get to play around with all the nice new features!

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)

 

Navigation:

[Reply to this 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

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