zoukankan      html  css  js  c++  java
  • 表一列数据根据其它表数据更新,备份表数据

    update [ResourceInfo] set[ResourceName]=replace(ResourceName,'''''','''')


    update b set [ResourceName]=a.[ResourceName] from [ResourceInfobak] a,[ResourceInfo] b where a.[ResourceGuid]=b.[ResourceGuid]

    SET IDENTITY_INSERT [ResourceInfo] off

    update c set c.[ResourceGuid]=b.[ResourceGuid] from Replancebak b, ResourceInfo c where b.ResourceName=c.ResourceName
    --备份表已存在
    Insert into [ResourceInfo] ([ResourceInfoID]
    ,[ResourceGuid]
    ,[ResourceName]
    ,[ResourceType]
    ,[UpdateUser])select [ResourceInfoID]
    ,[ResourceGuid]
    ,[ResourceName]
    ,[ResourceType]
    ,[UpdateUser] from [ResourceInfobak]

    --备份表不存在
    SELECT * into AgreementResourcebak from AgreementResource
    SELECT * into ResourceInfobak from ResourceInfo
    --更新协议资源表
    update a set a.[ResourceGuid]=b.[ResourceGuid] from AgreementResource a, Replance b, ResourceInfo c where a.[ResourceGuid]=c.[ResourceGuid] and b.ResourceName=c.ResourceName
    --更新资源表
    update c set c.[ResourceGuid]=b.[ResourceGuid] from Replance b, ResourceInfo c where b.ResourceName=c.ResourceName

  • 相关阅读:
    UIimageView和UIimage的小区别
    transform
    block的一些注意事项
    category与协议的不同
    类扩展和category的小区别
    category的概念
    OC中的类扩展
    Java学习 第三章 java基础(三)
    Java学习 第三章 java基础(二)
    Java学习 第三章 java基础(一)
  • 原文地址:https://www.cnblogs.com/shiyh/p/7754089.html
Copyright © 2011-2022 走看看