DECLARE rs CURSOR LOCAL SCROLL FOR
SELECT RowIndex,Name FROM Real_CIU_VesselGeometry_CellSection
OPEN rs
FETCH NEXT FROM rs INTO @tempRowIndex,@tempName
WHILE @@FETCH_STATUS = 0
BEGIN
UPDATE Real_CIU_VesselGeometry_CellStack_cnvs SET Parent_covs = @tempRowIndex WHERE ParentName = @tempName
FETCH NEXT FROM rs INTO @tempRowIndex,@tempName
END
CLOSE rs
DEALLOCATE rs
数据库游标
原文地址:https://www.cnblogs.com/zxf12107/p/14082325.html