大家看看这句话的执行过程 exec('if (select 以太网 from 设备型号 where 型号='+@device_type+ ...+'...'+')=1)这样语法就没有问题了。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 试试这样: declare @int int exec('select '+@int'+'=以太网 from 设备型号 where 型号='+@device_type) if @int=1 begin ..... end 更正:exec('if (select 以太网 from 设备型号 where 型号='+@device_type+ ...+'...'+')=1)')这样语法就没有问题了。 declare @temp int --局部变量select @temp=以太网 from 设备型号 where 型号=@device_typeif @temp=1 select '是1'else select '不是1' sql 如何将某个字段的聚集索引改为非聚集索引 ---马上结贴 谁有 用sql 做过库存报表啊 给参考参考 主键问题,问大侠们是为什么? 一个有关联合查询的问题 SSIS读取文件并把数据存入数据库,在线等!急 数据库太大,如何进行备份,谢谢! vc里调用sqlserver存储过程如何调用 两个表的连接问题! sql server 安装问题 这么晚跑上来问一个比较弱的问题,关于SQL Server的,请大家看看 help me!!!!!!! thanks a lot!!!!!! a simple question about asp !!!! 在VC中嵌入存储过程,该如何传参数?
declare @int int
exec('select '+@int'+'=以太网 from 设备型号 where 型号='+@device_type)
if @int=1
begin
.....
end
exec('
if (select 以太网 from 设备型号 where 型号='+@device_type+
...+'...'+
')=1)
')
这样语法就没有问题了。
select @temp=以太网 from 设备型号 where 型号=@device_type
if @temp=1
select '是1'
else
select '不是1'