随笔分类 - Sql
摘要:sql经常会遇到“将截断二进制或字符串”的错误——处理办法 1、修改列长度——无法定位具体字段 2、程序逻辑中增加判断,以定位具体字段 由于我是在报表数据库中直接写SQL,没有校验逻辑,所以想把全部字段的长度都增加到最大。写了批量脚本:
阅读全文
摘要:1 --从10001起,借用生成的行号,批量编号表记录 2 3 declare @start int = 10000; 4 5 update t1 set t1.newNo=t2.newNo 6 from student t1 7 join (select id, (row_number() over(order by id) + @start) newNo from student) t2...
阅读全文

浙公网安备 33010602011771号