Connecting Tech Pros Worldwide Forums | Help | Site Map

Sql Server Alter statement

Member
 
Join Date: Aug 2006
Location: USA
Posts: 92
#1: Oct 13 '08
Hi all,

If I want to add more than one table to an existing table. What is the syntax. Can any one please help me finding this....

For One table:
--------------------
alter table tbl_Name
add column col_name varchar(200);

More than One?.

Thanks & Regards
Bharath Reddy VasiReddy
Member
 
Join Date: Aug 2006
Location: USA
Posts: 92
#2: Oct 13 '08

re: Sql Server Alter statement


hi all here i got a nice article on alter statements:

To add multiple columns to an existing table, the ALTER TABLE syntax is:

ALTER TABLE table_name
ADD ( column_1 column-definition,
column_2 column-definition,
...
column_n column_definition );

For example:

ALTER TABLE supplier
ADD ( supplier_name varchar2(50),
city varchar2(45) );

This will add two columns (supplier_name and city) to the supplier table.

For More infromation Please visit this page:
http://www.techonthenet.com/sql/tables/alter_table.php

Enjoy Coding........


Bharath Reddy VasiReddy
Reply