Given the table created using:
CREATE TABLE tbl_Country
(
CountryId INT NOT NULL AUTO_INCREMENT,
IsDeleted bit,
PRIMARY KEY (CountryId)
)
How can I delete the column IsDeleted
?
Given the table created using:
CREATE TABLE tbl_Country
(
CountryId INT NOT NULL AUTO_INCREMENT,
IsDeleted bit,
PRIMARY KEY (CountryId)
)
How can I delete the column IsDeleted
?
To delete a single column from a table you can use this:
To delete multiple columns, do this:
When we perform an operation like deleting a column from the table it changes the structure of your table. For performing such kind of operation we need to use Data Definition Language (DDL) statements. In this case we have to use ALTER statement.
ALTER - alters the structure of the database
The query would be -
You can use
To delete columns from table.
Or without word 'COLUMN'
Use
ALTER TABLE
withDROP COLUMN
to drop a column from a table, andCHANGE
orMODIFY
to change a column.