case...when...then...语句在存储过程中嵌套联合查询报错
create proc GetReportasbegininsert into dbo.OneceShop(cid,Clayer,DistrictCode,DistrictName,createdate)select a.cid,case a.Clayer when '1' then '总代' when '2' then '省代' when '3' then '办事处' when '4' then '区代' when '5' then '一次店' when '6' then '二次店' end,b.DistrictCode,b.DistrictName,getdate()from dbo.TPUBCLIENTINFO a,TPubDistrict b where a.caddprovince=b.struccode order by DistrictNameend
消息 8152,级别 16,状态 14,过程 GetReport,第 4 行将截断字符串或二进制数据。语句已终止。