The ALTER TABLE statement is used to add, delete, or modify columns in an existing table. The ALTER TABLE statement is also used to add and drop various constraints on an existing table.
The syntax for dropping a unique constraint in MySQL is: ALTER TABLE table_name DROP INDEX constraint_name; table_name. The name of the table to modify.
Use SQL Server Management Studio Select the column for which you want to modify the data type. In the Column Properties tab, select the grid cell for the Data Type property and choose a new data type from the drop-down list. On the File menu, select Save table name.
Do you mean altering the table after it has been created? If so you need to use alter table, in particular:
ALTER TABLE tablename MODIFY COLUMN new-column-definition
e.g.
ALTER TABLE test MODIFY COLUMN locationExpect VARCHAR(120);
Syntax to change column name in MySql:
alter table table_name change old_column_name new_column_name data_type(size);
Example:
alter table test change LowSal Low_Sal integer(4);
This should do it:
ALTER TABLE test MODIFY locationExpert VARCHAR(120)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With