select * from a where 姓名="+xingming+"?大牛帮忙啊。。 小弟需要在a表里查询姓名字段,但字段内容是_bstr_t变量,请问下面的写法有问题吗??select * from a where 姓名="+xingming+", 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from a where 姓名=@name exec('select * from tb where '+@字段变量+'=xxx') 有点迷。。是select * from a where 姓名="+@xingming+"么?? LZ SQL 基础有点差,去学校学一下吧:http://www.w3school.com.cn declare @xingming varchar(50)set @xingming='aaa'select * from a where 姓名=@xingming 你这个应该是在程序中传入的变量吧?先把_bstr_t付一个变量名,假设为@name,然后把_bstr_t的值传到@name中,再select * from a where 姓名=@name即可。 找SQL共同学习的朋友 请教一个Sqlserver下的长sql语句 达人帮助:mssql2005里附加了一个sql2000数据库这怎么连接 在虚拟主机(SQL2000)上。如何将SQL2000中的数据备份?? sql server 2000 安装问题 (安装现场等待!!!) 特急: Sql 2005 安装要结束了出现 无法在COM+目录中安装和配置程序集 难道SQL不支持大型数据库? SQL的处理步骤???/ 关于打开.sql文件的问题 插入了多行数据,触发器中怎样判断?谢谢了! 大家新年好!请教一个关于连续时间查询问题? 数据空值替换问题
是select * from a where 姓名="+@xingming+"么??
http://www.w3school.com.cn
set @xingming='aaa'
select * from a where 姓名=@xingming
select * from a where 姓名=@name即可。