MS SQL 怎么写check约束

来源:百度知道 编辑:UC知道 时间:2024/06/05 01:38:45
create table x
(
a char(1) check....要求 A-Z(这里应该怎么写)
)
请问应该怎么写
数据库强者
------
这样小写的a也可instert
insert into x values('a') 不会报错

怎么弄 check 大写的 A-Z 谢谢

---------------------------------
照你那样做了
insert into x values('d') 不会报错
insert into x values('f') 也可插入

你自己去搜索下敏感大小写字符集 sqlserver

只能够这样:

按照我的操作来!

create table table7
(
test varchar(20) --check (test like '[A-Z]')
)

然后执行:

alter table table7 ALTER COLUMN test varchar(50) COLLATE Chinese_PRC_CS_AI
go

然后再:
alter table table7 add constraint test_fjk check(test like '[A-Z]')

然后你再插入试试看!