表结构变化

改变字段长度:

ALTER table schema.table_name ALTER column_name set data type VARCHAR(10);

call sysproc.admin_cmd('reorg table schema.table_name ');
call sysproc.admin_cmd('runstats on table schema.table_name with distribution and indexes all');

增加字段:

ALTER TABLE schema.table_name
ADD COLUMN column_name VARCHAR(100) NOT NULL WITH DEFAULT '*';
call sysproc.admin_cmd('reorg table schema.table_name ');
call sysproc.admin_cmd('runstats on table schema.table_name with distribution and indexes all');

加注释:
COMMENT ON COLUMN table_name.column_name IS '注释';
删除字段:
ALTER TABLE schema.table_name 
DROP COLUMN column_name

 

posted @ 2018-04-28 11:42  fosonR  阅读(170)  评论(0编辑  收藏  举报