ALTER COMMANDS ON SQL SERVER

Learning the basics of SQL is always helpful for a technical professional.

Below are the SQL commands to

  • Add a new column to the existing table
  • Change the data type of the column
  • Drop a column from the table
ALTER TABLE [HumanResources].[Department]
ADD  EMAILID CHAR(20)

This adds a new column ‘Emailid ‘ to the table

ALTER TABLE [HumanResources].[Department]
ALTER COLUMN EMAILID VARCHAR(50)

Above statement changes the datatype of the column

ALTER TABLE [HumanResources].[Department]
DROP COLUMN EMAILID

Above statement deletes the columns from the table.

Original Post https://anithasantosh.wordpress.com/2025/10/09/alter-commands-on-sql-server/

0 Votes: 0 Upvotes, 0 Downvotes (0 Points)

Leave a reply

Follow
Search
Popular Now
Loading

Signing-in 3 seconds...

Signing-up 3 seconds...