create table test
( f1 varchar(100))insert into test  exec('select (10+8)*8-2+10')select * from testdrop table test/*
f1                                                                                                   
--------------- 
152
*/

解决方案 »

  1.   

    转换一下即可create table test
    ( f1 varchar(100))
    insert into test select Convert(varchar(100),(10+8)*8-2+10)
      

  2.   

    create table test
    ( f1 varchar(100))create table aa
    (c  varchar(100))
    insert into aa
    select '(10+8)*8-2+10'union
    select '(10+8)*8'union
    select '10+8'
    declare @s varchar(8000)
    set @s=' '
    select @s=@s+'select '+c+' union ' from aa
    set @s=left(@s,len(@s)-5) insert into test  exec(@s)select * from test drop table test
    drop table aa/*
    f1                                                                                                   
    ----------  
    18
    144
    152
    */ 
      

  3.   

    jinjazz(近身剪*10年磨一贴)
    牛人!!!!
    钦佩万分!!!!!!