|
发表于 2020-7-9 15:30:01
|
显示全部楼层
declare @g_Condi2 varchar(1000)
set @g_Condi2= 'and State = ''在职'''
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=''张三'''+@G_Condi2+'');
select * from #test |
|