CREATE TABLE Students
(
Student_ID INT IDENTITY,
[First Name] VARCHAR(35),
[Middle Name] VARCHAR(35),
[Last Name] VARCHAR(35),
DOB DATE,
Age AS DATEDIFF(yyyy,DOB,GETDATE()) -- Computed Column Auto Genarate Age Based on BirthDay when inserting
CONSTRAINT [Primary Key For Students Table] PRIMARY KEY(Student_ID),
)
When i insert a record to the student table Age will be Automatically Calculate and store in Age Field.assume that i have 10 records in student table.
this is my prob
i want to calculate age of all 10 students every day and automatically update age field accoding to their DOB.in simple word student table (Age) Field should be automatically genarate age for each student every day.how can i do this.

New Topic/Question
Reply


MultiQuote





|