//取得数据库表名  
  select   name   from   sysobjects   where   xtype='u' order by name  
   
  //取得数据库表的字段  
  select   c.*   from   syscolumns   c,   sysobjects   o  
  where   c.id   =   o.id   and   o.type   =   'U'   and   o.name   = 'tableName'  

  //修改数据库字段名  
  EXEC   sp_rename   'tablename.oldcolumnname',   'newcolumnname'  
   
  //新增数据库字段  
  ALTER   TABLE   tablename   ADD   newcomlum   int   NULL  
   
  //删除数据库字段  
  ALTER   TABLE   tablename   DROP   COLUMN   newcomlum

posted on 2008-12-09 10:57  自己  阅读(567)  评论(2编辑  收藏  举报