展开全部
思路:
1、首先搞清楚所有表636f707962616964757a686964616f31333335333064的主外键关系
2、取消全部表的主键自增标识列,方便你后续的直接修改ID
例如:exec sp_configure 'allow updates',1
reconfigure with override
GO
----取消标识列标记
update syscolumns set colstat = 0 where id = object_id('表名') and colstat = 1
GO
----恢复标识列标记
update syscolumns set colstat = 1 where id = object_id('表名') and name = '标识列名称'
3、写个SQL脚本,修改ID,在修改的时候,一并更新全部表里的此ID值
例如:declare @old_id as int,@new_id as int
select @old_id=12,@new_id=123
update 表名1 set id=@new_id where id=@old_id
update 表名2 set id=@new_id where id=@old_id
update 表名3 set id=@new_id where id=@old_id
.....
update 表名n set id=@new_id where id=@old_id