|
To sum up, the correct statement is:
set @strSql ='insert into #indextable(CompanyID,CompanyName,Address,Phone,Place)'+
'select CompanyID, CompanyName,Address,Phone,Place from Company where Place like''%'+@strPlace+'%'''
exec(@strSql)
There are 2 mistakes: one is that there is no space before; the other is that two %s need to be quoted. |
|