This feature introduced in Sql Server 2005
- Computed columns are virtual columns that are not physically stored in the table.
- Their values are recalculated every time they are referenced in a query.
- The Database Engine uses the PERSISTED keyword in the CREATE TABLE and ALTER TABLE statements to physically store computed columns in the table
- You can create an index on a computed column that is deterministic but not precise.
- Computed columns can be used in select lists, WHERE clauses, ORDER BY clauses, or any other locations in which regular expressions can be used.
Limitation
- Computed columns are virtual columns that are not physically stored in the table.
- Their values are recalculated every time they are referenced in a query.
- The Database Engine uses the PERSISTED keyword in the CREATE TABLE and ALTER TABLE statements to physically store computed columns in the table
- You can create an index on a computed column that is deterministic but not precise.
- Computed columns can be used in select lists, WHERE clauses, ORDER BY clauses, or any other locations in which regular expressions can be used.
| Example :1 |
- A computed column cannot be the target of an INSERT or UPDATE statement.
- You can not reference columns from other tables for a computed column expression directly.
- If you are combining operators of two different data types in your expression then operator of lower precedence will be converted to that of higher precedence. If implicit conversion is not possible then error will be generated.
No comments:
Post a Comment