SQL中PERSISTED关键字
2013-08-05 21:05
176 查看
PERSISTED 指定 SQL Server 数据库引擎将在表中物理存储计算值,而且,当计算列依赖的任何其他列发生更新时对这些计算值进行更新。将计算列标记为 PERSISTED,可允许您对具有确定性、但不精确的计算列创建索引。有关详细信息,请参阅为计算列创建索引。用作已分区表的分区依据列的所有计算列都必须显式标记为 PERSISTED。指定 PERSISTED 时,computed_column_expression 必须具有确定性。
create table orders ( orderid int not null, price money not null, quantity int not null, orderdate datetime not null, total as price*quantity , total2 as Price * quantity persisted, shipedate as dateadd (day,7,orderdate) ) insert into orders (orderid,price,quantity,orderdate) values (1,2,6,'2008-8-8')
相关文章推荐
- 【转】SQL 常用关键字释义和用法
- access 关键字影响 sql语句报错
- Mysql和Sql Service语法和关键字区别
- SQL——SQL语言全部关键字详解
- 直接从数据库中搜索出带红色关键字的sql语句
- SQL语句的各个关键字的解析过程详细总结
- SQL_DEFAULT关键字
- SQL保留关键字不能用作表名
- SQL--关键字的一些内容
- sql 替换内容关键字
- SQL保留关键字误作为字段使用报错SQL Error: 1064, SQLState: 42000
- SQL关键字转换大写核心算法实现
- 关于Sql语句中的模糊查询like关键字详解
- SQL之merge into 批量更新数据 Merge关键字是一个神奇的DML关键字。它在SQL Server 2008被引入,它能将Insert,Update,Delete简单的并为一句。M
- sql连接查询中,where关键字的位置
- sql中的left join以及on、where关键字的区别
- SQL INNER JOIN 关键字 用法
- 在论坛中出现的比较难的sql问题:11(字符分拆 多关键字匹配问题)
- SQL查看关键字是否是某表中列名
- SQL 的 IFNULL 关键字的用法