如何在一个字段之前插入一个字段.
求SQL语句?

解决方案 »

  1.   

    我要有SQL语句,我是要在程序中实现呀!
    企业管理器谁都会呀!~
    老大!
      

  2.   

    ALTER TABLE doc_exa ADD column_b VARCHAR(20)
      

  3.   

    先添加字段
    在对应sysobjects中update对应的表的字段值的顺序!
      

  4.   

    create table table_test(id int,code varchar(10))alter table table_test add name varchar(20)exec sp_configure 'allow update',1
    reconfigure with overrideupdate syscolumns
    set colid = colid + 1
    where name in ('code','name') and id = object_id('table_test')
    GOupdate syscolumns
    set colid = 2
    where name = 'name' and id = object_id('table_test')exec sp_configure 'allow update',0
    reconfigure with override