I have a custom function, and I am trying to created a persisted column using this function.
It is giving me following error.
Computed column
How about specifying the definition directly:
ALTER TABLE SomeTable ADD FormattedSSN as case when len(EmployeeSSN) = 9 then substring(EmployeeSSN, 1, 3) + '-' + substring(EmployeeSSN, 4, 2) + '-' + substring(EmployeeSSN, 6, 4) else EmployeeSSN end PERSISTED