我的存储过程中有这样一条,引号加的不对set @insertstring = 
'select * into ' + @city +
' from  table  where companies like ''%' + @city+ '%'''请各位帮帮忙

解决方案 »

  1.   

    declare @insertstring varchar(1000)
    declare @city varchar(1000)
    set @city='武汉'
    set @insertstring = 
    'select * into ' + @city +
    ' from  table  where companies like ''%' + @city+ '%'''
     print @insertstring
    好象没错
      

  2.   

    select * into 武汉 from  table  where companies like '%武汉%'
      

  3.   

    试试看
    set @insertstring = 'select * into '+@city+' from  table  where companies like ''%'+''+@city+''+'%'''
    like部分应该这样写,@city部分如果还不对再改改