Re: Triiger -vs- Constraint



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

>Hugo Kornelis (hugo@xxxxxxxxxxxxxxxxxxxxxx) 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)
.



Relevant Pages

  • Re: Triiger -vs- Constraint
    ... but you still can't use it in a FOREIGH KEY constraint. ... CREATE TABLE c (c int NOT NULL PRIMARY KEY) ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ...
    (comp.databases.ms-sqlserver)
  • Re: SQL Humor
    ... Hugo Kornelis wrote: ... SQL Server will often produce the same execution for both versions. ... the big questions for the RM, *for me* seem to include view updatability which has to do with the operators of the algebra as well as whether a relational engine can implement customary features such as concurrency control and presentation coherence without being written in a language that eschews the relational operators. ...
    (comp.databases.theory)
  • Re: Need help with hint syntax in SQL Server 2000
    ... unable to recognize that it shoul push the where clause condition down ... Hugo Kornelis, SQL Server MVP ... My SQL Server blog:http://sqlblog.com/blogs/hugo_kornelis ... Thank you both for the replies. ...
    (comp.databases.ms-sqlserver)
  • Re: Help with missing data in query
    ... I did go to that site But I couldn't figure out how to upload anything. ... GROUP BY m.MonthName WITH ROLLUP ... Hugo Kornelis, SQL Server MVP ...
    (microsoft.public.sqlserver.mseq)
  • Re: How to Gnerate a Random ID Number
    ... formula with a seed as input to get at a pseudo-random value?) ... that definitely rules out newid() as a "good" pseudo random number ... this on SQL Server 2005, and the seed does not seem to be reset (or at ... Hugo Kornelis, SQL Server MVP ...
    (comp.databases.ms-sqlserver)