select aa.PSCode, aa.RegionName,aa.PSName,aa.CorporationCode,aa.CommunicateAddr,aa.Linkman,null ContractID
into #bankcontract
from
(select b.PSCode,a.RegionName, b.PSName, b.CorporationCode, b.CommunicateAddr, b.Linkman
from Dictionary.Region a , PSInfo.PSBaseInfo b
where a.RegionCode = b.RegionCode and b.DeleteFlag = 0 and b.Status = 0 and b.RegionCode=330109000) aa
update #bankcontract
set ContractID=aa.ContractID
from
(select b.ContractID ,b.PSCode
from #bankcontract a ,PSInfo.BankContract b
where a.PSCode=b.PSCode) aa
where aa.PSCode=#bankcontract.PSCode
我的 set ContractID=aa.ContractID 在更新时 会报 转换 varchar 值 '1111111111111' 时溢出了整数列。
上面 是这么定义的 null ContractID
请问下怎么解决这个问题 还有 null ContractID 的默认类型是什么?
------解决方案--------------------
用cast( ' ' as varchar(255)) as ContractID