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

Join Us
  • X Network2.1K
  • LinkedIn3.8k
  • Bluesky0.5K
Support The Site
Events
November 2025
MTWTFSS
      1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
« Oct   Dec »
Follow
Search
Popular Now
Loading

Signing-in 3 seconds...

Signing-up 3 seconds...