Newbie Question. Visio

Hi am creating a database and am currently drawing up the layout of the database diagram.

Am stuck on a question where am supposed to make a condition where the data of issue is invalid after 30 days.

Am struggling to understand if I do this in the constraint clause which to me seems to most logical option.

Am also struggling how to write this in SQL, if it is actually possible in SQL.

- Josh

November 28th, 2014 10:53am

google is your friend when you have homework assignments, try using this as a search

sql server constraint date

al

Free Windows Admin Tool Kit Click here and download it now
December 1st, 2014 3:34pm

Hi,

Would you like to telling us more clarity about your question? My understating is that you have 2 questions.

1. You want to draw a drawing up the layout of the database diagram and add a rule(the data is invalid after 30 days.)

2. You want to create the SQL database based on the Visio diagram. 

If #1 yes, you'd better tell us which template are you using or upload a sample file via OneDrive, we could help you better.

If #2 yes, please try the Al's suggestion " SQL server constraint date". See the sample code:

ALTER TABLE yourTable
ADD CONSTRAINT yourDateTimeColumn CHECK (yourDateTimeColumn < GetDate() );

If you have any update, please feel free let us know.

Regards,

George Zhao
TechNet Community Support

December 2nd, 2014 10:30am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics