Update dbo.PartOpr
        Set 字段=值
-- 存在記錄才更新
Where OperationDesc=@OperationDesc 
    and TopVersion=@TopVersion 
    and DrawNum=@DrawNum  
    and TopPartNum=@TopPartNum 
    and [Version]=@Version
 
 
Insert into dbo.PartOpr(字段)
    Select 
            字段
        -- 不存在記錄才插入
        Where Not exists(select from dbo.PartOpr               
                            Where OperationDesc=@OperationDesc 
                                and TopVersion=@TopVersion 
                                and DrawNum=@DrawNum  
                                and TopPartNum=@TopPartNum 
                                and [Version]=@Version
                    )

相关文章:

  • 2022-12-23
  • 2021-11-03
  • 2022-02-13
  • 2022-03-05
  • 2021-10-03
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-12
  • 2021-05-15
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案