导航

用SQL语句创建和删除Access数据库中的表;添加列和删除列

Posted on 2009-08-11 13:42  yunbo  阅读(1663)  评论(0编辑  收藏  举报

用SQL语句创建和删除Access数据库中的表;添加列和删除列
SQL语句,具体使用方法请看帮助  
   
   Create    Table    tab1    (fld1    integer)  
   Drop    Table    tab1  
   
   Alter    Table    tab1    Add    COLUMN    col1    integer  
   Alter    Table    tab1    Drop    COLUMN    col1

2
建立数据表  
   create    table    数据表名称(字段名称1    数据类型1(数据长度),字段名称2    数据类型2(数据长度),...)  
   
   删除数据表  
   drop    table    数据表名称  
   
   编辑数据表  
   添加字段  
   alter    table    数据表名称    add    字段名称    数据类型(数据长度)  
   
   删除字段  
   alter    table      数据表名称    drop    字段名称  
   
   字段更名  
   没有直接的更名语句,但可以用先删再除添加的方法实现  
   


3
建立数据表  
   create    table    数据表名称(字段名称1    数据类型1(数据长度),字段名称2    数据类型2(数据长度),...)  
   
   删除数据表  
   drop    table    数据表名称  
   
   编辑数据表  
   添加字段  
   alter    table    数据表名称    add    字段名称    数据类型(数据长度)  
   
   删除字段  
   alter    table      数据表名称    drop    字段名称
 ALTER TABLE Table1 ADD COLUMN NewCol TEXT(10) DEFAULT 'abc'