Error validating check constraint sql server
Converting rules before they're extinct will save you a lot of time and trouble later on.To learn more about constraints visit: Sales Harkins is an independent consultant and the author of several articles and books on database technologies.
But, tell me, how would you tell to which century does '05-Apr-07' birth-date belong.Thanks Littlefoot, It's working - Appreciated I have 1 more query on date type data I want to insert data through query..this table CREATE TABLE bd ( dob DATE, dod DATE, CONSTRAINT ch_db CHECK (dod = dob) ); Right now I can only insert date in DD-MMM-YY format for ex: INSERT INTO bd VALUES ('10-May-97', '10-May-05'); so here problem is, my expectation 10-May-97 = 10-May-1997 but it is taking it as 10-May-2097 and inserts date Would you please let me know, how to restrict oracle to accept only such kind a format for date... For Oracle format models, consult the documentation found eg. like DD-MM-YYYY only Thanks'10-May-97' is a STRING. In this case, the table accepts only one value, 406045555.Laying siege to bad data from the get-go will reduce mistakes and the headaches later on.
Search for error validating check constraint sql server:
In other words, you're making sure that all of the data for a single column (or a table) meets specific conditions.