56  
查询码:00001024
修复数据库自增列
作者: 刘波 于 2024年11月18日 发布在分类 / 小精灵pro 下,并于 2024年11月18日 编辑
修复数据库自增列


--修复自增列:
use stdssv10--数据库名请根据修复的数据库进行跟换,如果是分部则为 hbposv8_branch
go
declare @tablename varchar(100)
declare test_cur cursor for
select object_name(id) from syscolumns
where status=128
open test_cur
fetch test_cur into @tablename
while @@fetch_status=0
begin
 DBCC CHECKIDENT (@tablename, RESEED)
 fetch test_cur into @tablename
end
close test_cur
deallocate test_cur
go





 推荐知识

 历史版本

修改日期 修改人 备注
2024-11-18 09:43:35[当前版本] 刘波 创建版本

联拓知识分享平台 -V 4.7.0 -wcp