Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (55.6k points)

Can anyone tell me how to change the datatype of a column in SQL?

1 Answer

0 votes
by (119k points)

In MS SQL, here is the syntax to change the datatype of a column:

ALTER TABLE table_name

ALTER COLUMN  ColumnName datatype;

In MySQL, here is the syntax to rename the column:

ALTER TABLE table_name

MODIFY COLUMN  ColumnName datatype;

If you want to learn SQL, you can enroll for this SQL course program by Intellipaat.

Related questions

0 votes
1 answer
0 votes
1 answer
asked Apr 19, 2020 in SQL by Sudhir_1997 (55.6k points)

Browse Categories

...