Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Columns to a Table

Status
Not open for further replies.

BiancaJ

Technical User
Nov 4, 2002
51
0
0
GB
Can I add a column to a database table without dropping and recreating the table?

The problem is that everytime a user creates an action that requires a new table - at the moment I drop the table and recreate the table with the new column.

This requires lots of resources as I have to populate the table again.

Is there a design way I can go around this?
 
Check out the Books OnLine, go to the Index tab and search on ALTER TABLE.


ALTER TABLE tablename
ADD COLUMN column_name <datatype>


example

ALTER TABLE mytable
ADD COLUMN mynewcolumn VARCHAR(10) NULL

-SQLBill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top