长度限制,你去掉一些空格:select '
case when khday <= 60       
  then je*0.015*(60 - khday) *       
     (select rate / 100 from rate1           
  where d1 =  khday - (select min(khdat - nowday) 
   from date1            
  where khday >= nowday )
   )else 0 end
'

解决方案 »

  1.   

    你把select 改为print就知道了,select显示的长度会有限制。
      

  2.   

    把select 改为print,select 确省的情况下最多显示256,或者可以用 vivianfdlpw() 的方法
      

  3.   

    不行的,我要用这个SQL做insert table1 exec(@sql)的
      

  4.   

    se @sql = select '
    case when khday <= 60       
      then je*0.015*(60 - khday) *       
         (select rate / 100 from rate1           
      where d1 =  khday - (select min(khdat - nowday) 
       from date1            
      where khday >= nowday )
       )else 0 end
    '