Subqueries are not allowed in this context. Only scalar expressions are allowed. :  create table employee(  Employee_ID int primary key,   Name nvarchar(20),   Gender nvarchar(2),   DOJ datetime,  Manager nvarchar(20),  Department nvarchar(20),  Tenure  as (SELECT DATEDIFF(year, GETDATE(),DOJ ) )     )    