create table test
( f1 varchar(100))insert into test exec('select (10+8)*8-2+10')select * from testdrop table test/*
f1
---------------
152
*/
( f1 varchar(100))insert into test exec('select (10+8)*8-2+10')select * from testdrop table test/*
f1
---------------
152
*/
( f1 varchar(100))
insert into test select Convert(varchar(100),(10+8)*8-2+10)
( 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
*/
牛人!!!!
钦佩万分!!!!!!