This question is in relation to user-defined scalar function to generate computed column
ALTER TABLE dbo.Installment ADD SurchargeCalculated AS (select Amount * Days * InstSurchargePercentage / 365 / 100 from InstallMentPlan where InstallMentPlan.PlanKey = Installment.PlanKey ) GO Error is:
Msg 1046, Level 15, State 1, Line 3
Subqueries are not allowed in this context. Only scalar expressions are allowed.
VIEWor similar.