Sql Server Alter statement

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bharathreddy
    New Member
    • Aug 2006
    • 116

    #1

    Sql Server Alter statement

    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
  • bharathreddy
    New Member
    • Aug 2006
    • 116

    #2
    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_definiti on );

    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.techonthene t.com/sql/tables/alter_table.php

    Enjoy Coding........


    Bharath Reddy VasiReddy

    Comment

    Working...