SQL: Computed Columns: It's a matter of persistence
Most SQL Server developers are aware that they can create computed columns. We do that by defining a column AS some expression like this:
![]()
Each time the value from that column is queried, the calculation is performed so the result can be returned. This makes sense when the value is changing regularly and the value is queried infrequently.
However, according to my completely subjective statistics, most computed columns are queried much more than they are ever changed. So why work the value out each and every time?
2017-10-30