Keyword PERSISTED in SQL

Source: Internet
Author: User
PERSISTED specifies that the SQLServer database engine will physically store computing values in the table, and update these computing values when any other column on which the calculation column depends is updated. Marking a computed column as PERSISTED allows you to create an index for a deterministic but inaccurate computed column. For more information, see create an index for a calculated column. Used

PERSISTED specifies that the SQL Server database engine physically stores computing values in the table, and updates these computing values when any other column on which the calculation column depends is updated. Marking a computed column as PERSISTED allows you to create an index for a deterministic but inaccurate computed column. For more information, see create an index for a calculated column. Used

PERSISTED
The specified SQL Server database engine will store the computing values in the table physically, and the Hong Kong Server will also be rented. These computing values will be updated when any other column on which the calculation column depends is updated. Marking a computed column as PERSISTED allows you to create an index for a deterministic but inaccurate computed column. For more information, see create an index for a calculated column. All calculation columns used as partition bases for partitioned tables must be explicitly marked as PERSISTED. When PERSISTED is specified, computed_column_expression must be deterministic.

Create table orders (orderid, price, quantity, orderdate, total as price * quantity, total2 as Price * quantity persisted, shipedate as dateadd (day, 7, orderdate), website Space

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.