我的存储过程中有这样一条,引号加的不对set @insertstring =
'select * into ' + @city +
' from table where companies like ''%' + @city+ '%'''请各位帮帮忙
'select * into ' + @city +
' from table where companies like ''%' + @city+ '%'''请各位帮帮忙
declare @city varchar(1000)
set @city='武汉'
set @insertstring =
'select * into ' + @city +
' from table where companies like ''%' + @city+ '%'''
print @insertstring
好象没错
set @insertstring = 'select * into '+@city+' from table where companies like ''%'+''+@city+''+'%'''
like部分应该这样写,@city部分如果还不对再改改