Thursday, January 24, 2013

SQL alter table column commands

Today I had to change a little bit some column of some database tables. I don't like in future to search the SQL-Commands again, so I like to add them to
my blog and hope, that they will also helpfully for you.
Drop Not Null Constraint from column :
ALTER TABLE TEST_ABC MODIFY ID_CUSTOMER bigint(20) NULL
Remove column
ALTER TABLE SALESORDER DROP columname1
Add column
ALTER TABLE CUSTOMER_ADRESS ADD testcolumnName2 VARCHAR(255) NULL
Rename column
ALTER TABLE WEB_SITE change `headerURL`  `headerURLorData` text
All commands are tested on MySQL 5.5.28.

No comments:

Post a Comment