关于exec的问题 declare @sql varchar(800)select @sql= 'select * from student where sex=''男'''exec (@sql)可能你是多了一个s 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 delcare @sql varchar(8000)select @sql='select * from student where ssex=''男'''-----------------------------------------^^是不是拼错了?,语法没有问题的. 而且exec运行一个sql字串的话,要将字串用()括起来 declare @a varchar(10)set @a='男'exec('select * from student where sex='''+@a+'''') exec (@sql) --< 少了一个括号 求 一条sql语句... 求一SQL语句,有点麻烦 怎样使局域网里的其它用户对我的数据库只读? sql server2000中varchar类型赋值怎么最多只能有255个字节呀 查找上接数据 怎样有条件的复制本身表? 请问这个SQL哪儿错了?(在线等) 请问各位大哥一个问题 image类型字段,如何用update命令更新 全文索引的问题:如何编辑干扰词?打不到Noise.chs文件 cursor只能有一个?? 这个sql语句怎么写???
select @sql='select * from student where ssex=''男'''
-----------------------------------------^^是不是拼错了?,语法没有问题的.
declare @a varchar(10)
set @a='男'exec('select * from student where sex='''+@a+'''')