sql-構造の変更
722 ワード
1、表名の変更
構文:
例:
2、フィールドの変更:
MySQL:
ALTER TABLE Customer MODIFY Address char(100);
Oracle:
ALTER TABLE Customer MODIFY Address char(100);
SQL Server:
ALTER TABLE Customer ALTER COLUMN Address char(100);
ref: SQL Modify Column Syntax
ref: http://stackoverflow.com/questions/5335528/sql-server-alter-rename-table
構文:
sp_rename old_table_name, new_table_name
例:
sp_rename t_review, t_business
2、フィールドの変更:
MySQL:
ALTER TABLE Customer MODIFY Address char(100);
Oracle:
ALTER TABLE Customer MODIFY Address char(100);
SQL Server:
ALTER TABLE Customer ALTER COLUMN Address char(100);
ref: SQL Modify Column Syntax
ref: http://stackoverflow.com/questions/5335528/sql-server-alter-rename-table