本文介绍了我想更新SMSCAMID,如果它是null否则没有变化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里是我的代码,但它不起作用



Here my code but its not worked

ALTER proc [exeuser].[updateCampaignId]
@SMSText varchar(max)
as begin
declare @id int=(select ID from dbo.tblCampaignMaster 
where SMSTEXT=@SMSText)
 
update tblSMSSendData set  SMSCAMPID= case when SMSCAMPID is null then @id end where SMSTEXT=@SMSText 
end





我尝试过:





What I have tried:

ALTER proc [exeuser].[updateCampaignId]
@SMSText varchar(max)
as begin
declare @id int=(select ID from dbo.tblCampaignMaster 
where SMSTEXT=@SMSText)
 
update tblSMSSendData set  SMSCAMPID= case when SMSCAMPID is null then @id end where SMSTEXT=@SMSText 
end

推荐答案

update tblSMSSendData set  SMSCAMPID=  @id   where SMSTEXT=@SMSText and SMSCAMPID is null 


这篇关于我想更新SMSCAMID,如果它是null否则没有变化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-25 04:17