SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Creating tables
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

aidmondo
Starting Member

Ghana
23 Posts

Posted - 05/12/2012 :  06:14:44  Show Profile  Reply with Quote
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?


Edited by - aidmondo on 05/12/2012 06:46:39

vijays3
Constraint Violating Yak Guru

India
311 Posts

Posted - 05/12/2012 :  06:25:55  Show Profile  Reply with Quote
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..
Go to Top of Page

sunitabeck
Flowing Fount of Yak Knowledge

5152 Posts

Posted - 05/12/2012 :  06:58:47  Show Profile  Reply with Quote
To enforce the condition that startdate will be always less than enddate, look up "check constraint"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
47173 Posts

Posted - 05/12/2012 :  19:53:56  Show Profile  Reply with Quote
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 MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000