Thursday 1 December 2011

Explain the ALTER table statement in SQL Server.

The ALTER table statement is used to add, delete or modify the columns in a table.

Ex :
To ADD a column in a table,

ALTER TABLE Employees

ADD DateofBirth date

This Query will display a new column “DateofBirth” in date format to Employees table.

To DELETE a column in a table,

ALTER TABLE Employees

DROP column DateofBirth

This Query will delete the column “DateofBirth” from Employees table.

Labels:


Bookmark this Blog in your Favorites

1 Comments:

Blogger Sudhir Chekuri said...

very nice post

dbakings

12 April 2013 at 08:04  

Post a Comment

Subscribe to Post Comments [Atom]

<< Home