Friday, March 25, 2016

Computed columns - Persisted Vs Non-persisted‏

http://www.sqlservercurry.com/2013/02/computed-columns-persisted-vs-non.html



There are two types of computed columns namely persisted and non-persisted. 

There are some major differences between these two

1. Non-persisted columns are calculated on the fly (ie when the SELECT query is executed) whereas persisted columns are calculated as soon as data is stored in the table.

2. Non-persisted columns do not consume any space as they are calculated only when you SELECT the column. Persisted columns consume space for the data

3. When you SELECT data from these columns Non-persisted columns are slower than Persisted columns

A computed column is not physically stored in the table, unless the column is marked PERSISTED.

No comments:

Post a Comment

https://blog.sqlauthority.com/2009/06/27/sql-server-fix-error-17892-logon-failed-for-login-due-to-trigger-execution-changed-database-context...