摘 要: 在SQL Server 2012中,当管理员完成数据库及表的建立后,后期对表中数据进行插入、修改、删除等操 作时由于操作不当,很可能会导致不符合规范的数据进入数据库。为避免这种情况发生,数据库表建立完毕后应通过数 据完整性来保证存储的数据正确、有效、相容。约束是实现数据完整性的有效手段之一,本文介绍不同类型数据完整性 的含义及实现手段,并结合具体的应用场景创建相关约束。 |
关键词: SQL Server;约束;数据完整性 |
中图分类号: TP392
文献标识码: A
|
|
The Design and Application of Database Constraints Based on SQL Server 2012 |
CHEN Xiao
|
( Xuzhou Vocational Technology Academy of Finance & Economics, Xuzhou 221008, China)
|
Abstract: In SQL Server 2012,after the database and the tables are set up,some abnormal data may enter the database caused by administrators' improper operations of inserting,modifying,deleting,etc.In order to avoid this situation,data integrity should be used to ensure the correctness,validness and compatibility of the stored data after setting up the database and the tables.Constraint is one of the effective means to achieve data integrity.This article describes the meaning and implementation of different types of data integrity,and creates related constraints in combination with specific application scenarios. |
Keywords: SQL Server 2012;constraint;data integrity |