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 |
Thechewinggummonster
Starting Member
8 Posts |
Posted - 2013-11-07 : 13:32:48
|
Without having to update it every day.This is so no one enters a value higher than the current date.ALTER TABLE Persons ADD CONSTRAINT chk_Person CHECK (Closed_Date>) |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2013-11-07 : 13:40:20
|
Take a look at the GETDATE() function.Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2013-11-11 : 03:08:10
|
One method isALTER TABLE #Persons ADD CONSTRAINT chk_Person CHECK (Closed_Date<=getdate())If the TIME part is not a problem, you can doALTER TABLE #Persons ADD CONSTRAINT chk_Person CHECK (Closed_Date<=dateadd(day,datediff(day,0,getdate()),1))MadhivananFailing to plan is Planning to fail |
|
|
|
|
|