Sponsored By
MindStick Cleaner
Advertise with Us
Advertisement
Advertise with Us
Follow Us
Follow _MindStick_ on Twitter View MindStick Software's LinkedIn profile View MindStick Software's Facebook profile
Mindstick
Article Article  Forum Forum  Blog Blog  Quiz Quiz  Beginner Beginner  Careers Careers  Contact Contact  Login Login  
Home | Product | Services | About Us | Interview | DeveloperSection | Submit an Article | Submit Blog
Report Abuse Form
Reason:    
   

Author Post

Jack C


Total Post: 10
Member Since: 9/29/2010
Points: 52
Alter Table
Posted On: 9/29/2010 1:44:12 PM
I have a table which contains 23 columns now due to project requirement I have to add few more columns in the existing table.
Column name like newLocation, oldCityName.
If possible provide me sample of code to add columns in a table.

Thanks in advance
Author Post

Amit Singh


Total Post: 104
Member Since: 8/8/2010
Points: 702
Re: Alter Table
Posted On: 9/30/2010 1:15:51 PM
we add the new column in a table by using alter command as
alter table tablename add columnname datatype constraints


alter table tablename add newLocation varchar(30), oldCityName varchar(20)



Author Post

Uttam Misra


Total Post: 113
Member Since: 6/2/2010
Points: 818
Re: Alter Table
Posted On: 10/3/2010 4:24:22 AM

To add a column to an existing table, the ALTER TABLE syntax is:

ALTER TABLE table_name
 ADD column_name column-definition;

For example:

ALTER TABLE employee
 ADD employee_name  varchar(50);

This will add a column called employee_name to the Employee table.

Report Abuse Form
Reason:    
 
Total Online Users: 2681
Advertisement
MindStick DataConverter
Advertise with Us
  
Copyright © 2013MindStick. All Rights Reserved.