zoukankan      html  css  js  c++  java
  • 游标使用之二

    ----循环查找构件表,在构件关系表中,给每个构件关联4张图纸
    declare @itemRowGuid varchar(50) declare auth_cur cursor for select RowGuid from [BIMPM_RoadBridge].[dbo].[ProjectConstructionItemInfo] where BidSectionRowGuid = '8373de62-4f87-4ca4-b741-30da6491785f-1' open auth_cur fetch next from auth_cur into @itemRowGuid while(@@FETCH_STATUS=0) begin INSERT INTO [dbo].[ProjectConstructionItemInfo_Relation] ([RowGuid],[ProjectConstructionItemInfoRowGuid],[RelationRowGuid],[RelationType],[ProjectRowGuid],[BidSectionRowGuid]) VALUES (NEWID(),@itemRowGuid,'3bb81ad1-c2c0-49b2-989f-57fdc7d833b8',1,'60ff4b50-2227-4ad2-8950-f7cdab801d6a','8373de62-4f87-4ca4-b741-30da6491785f-1') INSERT INTO [dbo].[ProjectConstructionItemInfo_Relation] ([RowGuid],[ProjectConstructionItemInfoRowGuid],[RelationRowGuid],[RelationType],[ProjectRowGuid],[BidSectionRowGuid]) VALUES (NEWID(),@itemRowGuid,'462e458b-24cc-4195-9df1-8e5bb69b7aa5',1,'60ff4b50-2227-4ad2-8950-f7cdab801d6a','8373de62-4f87-4ca4-b741-30da6491785f-1') INSERT INTO [dbo].[ProjectConstructionItemInfo_Relation] ([RowGuid],[ProjectConstructionItemInfoRowGuid],[RelationRowGuid],[RelationType],[ProjectRowGuid],[BidSectionRowGuid]) VALUES (NEWID(),@itemRowGuid,'21978931-d354-4185-993a-194e4b41479e',1,'60ff4b50-2227-4ad2-8950-f7cdab801d6a','8373de62-4f87-4ca4-b741-30da6491785f-1') INSERT INTO [dbo].[ProjectConstructionItemInfo_Relation] ([RowGuid],[ProjectConstructionItemInfoRowGuid],[RelationRowGuid],[RelationType],[ProjectRowGuid],[BidSectionRowGuid]) VALUES (NEWID(),@itemRowGuid,'fd1caf80-7877-493a-9cd3-ff2ca861d1de',1,'60ff4b50-2227-4ad2-8950-f7cdab801d6a','8373de62-4f87-4ca4-b741-30da6491785f-1') fetch next from auth_cur into @itemRowGuid end close auth_cur

      

  • 相关阅读:
    Java(14):面向对象、封装、继承、方法重写、多态、抽象类与接口、内部类
    Java(13):数组、Arrays类、冒泡排序
    Java(12):方法、重载、命令行传参、可变参数、方法调用
    Java(11):switch、dowhile、九九乘法表、打印质数、打印三角形
    Java(10):用户交互Scanner
    Java(9):包
    Java(8):运算符
    Java(7):变量和常量及其规范、作用域
    Mybatis 打印日志
    mysql 更新数据
  • 原文地址:https://www.cnblogs.com/wangzuofei/p/6013447.html
Copyright © 2011-2022 走看看