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-12 : 06:14:44
|
| I want to create two columns StartDate and endDate but I'll have to create a rule for the startDate to be lesser than the EndDate. How do I create this? |
|
|
vijays3
Constraint Violating Yak Guru
354 Posts |
Posted - 2012-05-12 : 06:25:55
|
| This are the columns you can create when u create a table ..and its depend on the logic how you load the data into these columns.. |
 |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-05-12 : 06:58:47
|
| To enforce the condition that startdate will be always less than enddate, look up "check constraint" |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-05-12 : 19:53:56
|
quote: Originally posted by aidmondo I want to create two columns StartDate and endDate but I'll have to create a rule for the startDate to be lesser than the EndDate. How do I create this?
although it can be done by means of check constraint. if this is for a webpage then best thing would be do validation at the client side if you want to avoid db calls for invalid input values------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|