set @tmp='select '+@OtherName+' = '+@OtherName+'+name
from others where otherId in ('+@OtherId+')'
exec(@sql)
from others where otherId in ('+@OtherId+')'
exec(@sql)
解决方案 »
- union的问题,请大家帮忙看看
- sp_send_dbmail
- 请教一个SQL 查询的问题
- 如何实现多重匹配的筛选,同时统计总数
- 用域帐户登陆后怎样调试本地的和别的机器的sql2005存储过程
- 一个SQL语句引发的血案?
- 如何保证两个数据库中的表与数据一值
- SQL查询语句的问题,有一定的难度,高手请进!!! 急~~~~~~~~在线等待
- 求救~~如何使两个SQL服务器中表结构相同的数据库中所有表的数据进行对比更新?
- 能否使用 通俗易懂 的解释告诉我什么是 hash 表 ,bucket ,如何使用 ,100分!!!
- 备份出现问题,顺便问一下如何给分。急!急!急!
- SQL Server2K 定時發送mail
from others where otherId in ('+@OtherId+')'
exec sp_executesql @tmp,N'@other varchar(500) output',@othername output
set @tmp='set @other='''' select @Other = @Other+name
from others where otherId in ('+@OtherId+')'
exec sp_executesql @tmp,N'@other varchar(500) output',@othername output