Friday 3 June 2011

How to alter or modify a table structure in sql server ?

  • Table structure altration or modifications :

    • Add column to existing table

      • alter table my_table add mid_name varchar(20)

    • Modify column to existing table

      • alter table my_table alter column mid_name varchar(40)

    • Drop column from existing table

      • alter table my_table drop column mid_name

No comments:

Post a Comment