update  table1 set aa='select * from table2 where bb=''是'''

解决方案 »

  1.   

    回复人: yanzheng1(光原) ( ) 信誉:100  2005-02-22 10:51:00  得分: 0  
     
     
       update  table1 set aa='select * from table2 where bb=''是'''
      
     
    这样 我的 里面的SQL 就不能执行了 select * from table2 where bb=''是''  我 里面的SQL 语句 以后要执行的
      

  2.   

    update  table1 set aa='select * from table2 where bb=''是'''
      

  3.   

    好像 你的UPDATE 存进去的  是:update  table1 set aa='select * from table2 where bb='是'不是update  table1 set aa='select * from table2 where bb=''是''我再试哈
      

  4.   

    能执行的sql server里字符串中的连续2个单引号表示是1个单引号,你保存到字段里后你看一下结果不是你说的select * from table2 where bb=''是''  
    而是select * from table2 where bb='是'
      

  5.   

    declare @sqlstr nvarchar(200)
    set @sqlstr=select 《SQL》 from biao where 《ID》=00001
    select @sqlstr
    update table1 set aa=@sqlstr
      

  6.   

    declare @a table(a1 nvarchar(50),a2 varchar(50))
    insert into @a(a1,a2)
    select '122','''456'''
    select * from @a单引号---->>双引号
      

  7.   

    感谢
     yanzheng1(光原) ( ) 信誉:100 
    NewQger(Q哥) ( ) 信誉:100 
    你们说的是对的  
    我现在就再程序里把 string xx="select * from table2 where bb='是'"
    转换成  string yy="select * from table2 where bb=''是''"
    就 可以 string zz=" update table1 set aa='+ yy +' "了 
    如果 你们知道C#里的字符串 的字符替换 函数  写个出来 也好
      先揭帖 哈  谢谢 所有参与本帖的朋友
      

  8.   

    yy=xx.Replace("'", "''")  已解决哦