posted 4/17/2009 by Vijendra Shakya
When we want to add,delete and delete the coloum in the exiting table then we use Alter Command.
Add a Column in a TableSyntex:
ALTER TABLE tableNameADD columnname datatype
Example:
ALTER TABLE EmpADD City Varchar(500) null
Add More than one colum at a time:
ALTER TABLE EmpADD (City Varchar(500) null,Country Varchar(500) null)
Delete a colum from the TableSyntex:
ALTER TABLE tableNameDROP COLUMN columnname
ALTER TABLE EmpDROP COLUMN City
Change datatype of Column.Syntex:
ALTER TABLE tableNameAlter COLUMN columnname datatype
ALTER TABLE EmpAlter COLUMN City nvarchar(400)
What kind of email newsletter would you prefer to receive from CodeAsp.Net?18