EXEC sp_rename 'aa.field1', 'dd', 'COLUMN'

解决方案 »

  1.   

    不要用exec,要使用的是纯正的sql
      

  2.   

    不可能,比如oracle就没办法改名字,每种数据库都是不同的。:)
      

  3.   

    begin tran
      alter table 表名 add 新列名 int
      update 表名 set 新列名=旧列名
      alter table 表名 drop column 旧列名
    commit tran
      

  4.   

    是exec sp_rename吧!哈哈。。哈哈。。
      

  5.   

    sp_rename不是很好吗,为什么不用?
      

  6.   

    楼上这个还不是吗??
    begin tran
      alter table 表名 add 新列名 int
      update 表名 set 新列名=旧列名
      alter table 表名 drop column 旧列名
    commit tran
      

  7.   

    alter table 这个应该好用