导航

sql语句修改表名和列名

Posted on 2008-09-18 20:10  风吟  阅读(1086)  评论(0)    收藏  举报

示例
  A.   重命名表   
  下例将表   customers   重命名为   custs。   
    
  EXEC   sp_rename   'customers',   'custs'   
    
  B.   重命名列   
  下例将表   customers   中的列   contact   title   重命名为   title。   
    
  EXEC   sp_rename   'customers.[contact   title]',   'title',   'COLUMN'  

注:已添加的列将无法删除