当前位置:首页 » 编程语言 » sqlserver的len

sqlserver的len

发布时间: 2024-10-30 08:41:24

‘壹’ sqlserver中怎么去掉单引号

如果确定单引号是在第一个字符的话,可以用三种方法实现:
1、right截取字符串函数配合len函数:

1
2

update 表 set 登记薄编号=right(登记薄编号,len(登记薄编号)-1) where left(登记薄编号,1)=''''
update 表 set 身份证号=right(身份证号,len(身份证号)-1) where left(身份证号,1)=''''

2、substring截取字符串函数:

1
2

update 表 set 登记薄编号=substring(登记薄编号,2,100) where left(登记薄编号,1)=''''
update 表 set 身份证号=right(身份证号,2,100) where left(身份证号,1)=''''

3、replace替换字符子串函数:

1
2

update 表 set 登记薄编号=replace(登记薄编号,'''','')
update 表 set 身份证号=replace(身份证号,'''','')

‘贰’ sqlserver存储过程 限制字段长度

inseterd 插入触发器里判断下数据长度len()是否为11,不为11不做插入操作

热点内容
java返回this 发布:2025-10-20 08:28:16 浏览:576
制作脚本网站 发布:2025-10-20 08:17:34 浏览:867
python中的init方法 发布:2025-10-20 08:17:33 浏览:565
图案密码什么意思 发布:2025-10-20 08:16:56 浏览:747
怎么清理微信视频缓存 发布:2025-10-20 08:12:37 浏览:667
c语言编译器怎么看执行过程 发布:2025-10-20 08:00:32 浏览:988
邮箱如何填写发信服务器 发布:2025-10-20 07:45:27 浏览:236
shell脚本入门案例 发布:2025-10-20 07:44:45 浏览:96
怎么上传照片浏览上传 发布:2025-10-20 07:44:03 浏览:789
python股票数据获取 发布:2025-10-20 07:39:44 浏览:695