Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
aidmondo
Starting Member
23 Posts |
Posted - 2012-05-14 : 06:47:21
|
| Create table Date( StartDate datetime not null, EndDate datetime not null)How do i use the CHECK Constraint to make the StartDate < EndDateaidmondo |
|
|
vijays3
Constraint Violating Yak Guru
354 Posts |
Posted - 2012-05-14 : 06:57:13
|
| [code]DO below one Create table Date(StartDate datetime not null ,EndDate datetime not null)alter table Date add check (StartDate < EndDate)[/code]Vijay is here to learn something from you guys. |
 |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-05-14 : 06:59:53
|
quote: Originally posted by aidmondo Create table Date( StartDate datetime not null, EndDate datetime not null)How do i use the CHECK Constraint to make the StartDate < EndDateaidmondo
ALTER TABLE [Date] ADD CONSTRAINT chkDates CHECK (StartDate < EndDate ); |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-05-14 : 22:44:13
|
quote: Originally posted by vijays3
DO below one Create table Date(StartDate datetime not null ,EndDate datetime not null)alter table Date add check (StartDate < EndDate) Vijay is here to learn something from you guys.
did you test this at all?Posted syntax is wrong!------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|