有一数据库,需要把同一表中的DD_001_info bis DD_050_info行的text写入DD_001_input bis DD_050_input行的info,没有ID。请问该如何做。

解决方案 »

  1.   

    select  字段名 ..然后生成一张新表.
    SELECT 字段名  INTO [myl].[dbo].[TaxRate] from ttest.dbo.TaxRate;  --无须建立TaxRate表.创建表并复制了记录.
      

  2.   

    没看懂,DD_001_info, bis , DD_050_info ,都是列名吗?还是一行数据?
      

  3.   

    update tb set b=a where 条件
      

  4.   

    DD_001_info, bis , DD_050_info ,是一列 
    name               text           INFO
    DD_001_info     aaaaaaaaaaa       NULL
    DD_001_input    hhhhhhhhhhh       NULL希望得到
    name               text           INFO
    DD_001_info     aaaaaaaaaaa       NULL
    DD_001_input    hhhhhhhhhhh       aaaaaaaaaaa能给一具体的update吗?
    update tb set INFO = @text 
    where 如何写
      

  5.   

    where name='DD_001_input' and text='hhhhhhhhhhh' and Info is null没主键的表,如果有完全相同的两行就没办法了,只能打开企业管理器自己去里面输了
      

  6.   

    alter table tb add id int identity 建一个 不就有 id 了改完后再把列删了alter table tb drop column id
      

  7.   


    这办法不错,改完后实际上也不用删了,多了这么个列基本上不会影响其他程序使用这个表(如果有在另一个表添加行时在触发器上对这个表添加行,并取@@IDENTITY的除外)
      

  8.   

    没有完全相同的两行
    解决了
    update tb set INFO = @text  
    where ..=replace(..,_input,_..)
      

  9.   

    update 表 set INFO = (select text from 表 where name ='DD_001_info') where name = 'DD_001_input'