Does anyone know if there is a way to achieve the same affect as a datetime column with a default binding of getdate() with computed columns?
I have tried setting the formula to getdate() and persist to Yes but I get an error
Computed column 'InsertDateTime' in table 'Tmp_Table' cannot be persisted because the column is non-deterministic.
forget the “computed column” and make it a regular not null column, with a default to
GETDATE(), or use anINSTEAD OF UPDATE/INSERTtrigger to set it.you can’t make a computed column use a function that constantly returns a different value (based on the same parameter values), it must return the same value each time (based on the same parameter values). Read this: Deterministic and Nondeterministic Functions