Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
数据库管理员是否可以覆盖数据类型可以保存的最大值bigint(使其小于文档中列出的值)?
bigint
是的,您可以在列上设置检查约束
例子
ALTER TABLE SomeTable ADD CONSTRAINT chkMaxValue CHECK (SomeCol < 123456 ); GO
您也可以使用触发器来限制它,但这太过分了
不,但您可以自己创建一个检查,以便值不会超过某个值,如下所示:
create table test_bigint( my_value bigint check (my_value <100) )