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

高手们,近来看看我的sql语句吧!!
declare   @aa   varchar(1000)
declare   @strSql   varchar(2000)

@strSql= 'select   @aa=(Address   +   Name   )from   crm_Customer   WHERE   ID   =1000 '

exec(@strSql)

print   @aa
请帮我排排错。。。。。。。。。。。万分感激!

------解决方案--------------------
declare @aa varchar(1000)
declare @strSql varchar(2000)
SET @aa= 'aass '
set @strSql= 'select '+ @aa + ' =(Address + Name ) from crm_Customer WHERE ID =1000 '

exec(@strSql)

--print @aa
print @strSql
------解决方案--------------------
@strSql= 'select @aa=(Address + Name )from crm_Customer WHERE ID =1000 '

这段错误很多
------解决方案--------------------
similarly answer below:

HTTP://www.ebigear.com/Fund/PlayNews.php?NewsID=28340&ID=285885


------解决方案--------------------
declare @aa varchar(1000)

set @aa= 'select (Address + Name )from crm_Customer WHERE ID =1 '

exec(@aa)
------解决方案--------------------
id=1000