|
发表于 2020-6-15 10:45:01
|
显示全部楼层
总结一下,正确语句为:
set @strSql = 'insert into #indextable(CompanyID,CompanyName,Address,Phone,Place)'+
'select CompanyID, CompanyName,Address,Phone,Place from Company where Place like ''%'+@strPlace+'%'''
exec(@strSql)
错误地方有2处:一个是where前没加空格; 另一个是两个%要加单引号。 |
|