|
declare @g_Condi2 varchar(1000)
set @g_Condi2 ='and State = ``Incumbent'''
create table #test
(name varchar(10),
sex bit,
address varchar(100),
photo image,
state bit
)
insert into #test
exec('select name,sex,address,photo,state from t_name
where name=``Zhang San'''+@G_Condi2+'');
select * from #test |
|