How can I add a check constraint to make sure that a date is equal to Today or within the last year and another check constraint to ensure that dateA is equal to dateB or earlier by a maximum of 3 days ?
Aussie_Here
0
Newbie Poster
Recommended Answers
Jump to PostYou have to use a trigger for this and not a constraint -- constraints can't check other column values. I tried the constraint approach and it did not work with referencing another column:
IF OBJECT_ID('TempTable', 'U') IS NOT NULL DROP TABLE TempTable Create Table TempTable ( RecordId …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.