日期:2014-05-18  浏览次数:20776 次

这里这么多符号是什么意思?mobile_num= ' ' ' ' '+@mobile+ ' ' ' ' ' ' ') '
set quoted_identifier off  
declare @sql nvarchar(1000) 
--set @mobile= 142423254 
set @sql= 'select * from OPENQUERY(mysqllinkserver, ' 'select uid from user1 where mobile_num= ' ' ' ' '+@mobile+ ' ' ' ' ' ' ') ' ----这里这么多符号是什么意思啊?
exec sp_executesql @sql 

set quoted_identifier on  



------解决方案--------------------
set @sql= 'select @uid=uid from OPENQUERY(mysqllinkserver, ' 'select uid from user1 where mobile_num= ' ' ' ' '+@mobile+ ' ' ' ' ' ' ') '