Answer the question
In order to leave comments, you need to log in
What is UC_Person in this SQL UNIQUE Constraint example?
Answer the question
In order to leave comments, you need to log in
What is UC_Person in this SQL UNIQUE Constraint example?The ID, LastName pair is unique.
...
[ID] [int] IDENTITY(1,1) NOT NULL
...
CONSTRAINT [PK_Persons] PRIMARY KEY CLUSTERED ( [ID] ASC )
...
...
[BirthDay] [datetime] NULL,
[DeathDay] [datetime] NULL,
[Age] [int] NULL AS DATEDIFF( Year, BirthDay, ISNULL( DeathDay, GETDATE()))
+ ( SIGN ( DATEDIFF ( DAY, BirthDay, DATEADD ( YEAR, YEAR( BirthDay )
- YEAR( ISNULL( DeathDay, GETDATE()) ), ISNULL( DeathDay, GETDATE())))) - 1 ) / 2
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question