主表
update RZ_PB_RZMainInfo set id = (newid())
where exists (select 1 from RZ_PB_RZMainInfo where AuthNo = AuthNo)
副表
update [dbo].[RZ_PB_RZMinorInfo] set mainId = (newid())
where exists (select 1 from [dbo].[RZ_PB_RZMinorInfo] where FbID = FbID)
给副表的mainId赋值
update [dbo].[RZ_PB_RZMinorInfo] set mainId = main.id from [dbo].[RZ_PB_RZMinorInfo] as minor,[dbo].[RZ_PB_RZMainInfo] as main where minor.AuthNo = main.AuthNo
03-16
1077
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-09
319
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
03-29