Hi, I need to create a SQL Table "Employees" table with the following fields:
ID, Name, Hiredate, Seniority
123, Johm, 11/8/1984, ????
For the Seniority field: if the current date - hiredate < 1 then 'Newbie'
****************************************************
My question is, should I put the seniority field as a calculation field? Or should I use the trigger to determine the employee is 'Newbie', 'Junior', or 'Senior'?
I have no clue how to either use the calculation to calculate the Seniority or use the trigger to do that.. Please help...
it depends on your requirement. To make this easy, you can use a calculated field for Seniority in a View or in Stored Procedure. And you no need to physically store it as a different field.