devxlogo

Deleting/Expanding a Column

Deleting/Expanding a Column

Question:
What is the proper method(s) to delete a column from a table or expand the size of a column in a table?

Adding is easy. Deleting and changing obviously is more complex.

Answer:
If you know how to add them then you are on the way to deleting and changing them:

alter table xadd [column name] [data type] alter table xdrop [column name]alter table xalter column [column name][new data type]

However, be aware that these examples only apply for SQL 7. Version 6.5 only allows you to add a column.

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist