QA


Q&A

Q1:

Can I add new columns or remove existing columns from a database table after I've already created and saved the table? What if the table contains rows?

A1:

You most definitely can alter a table's structure after it has been savedeven if it has existing rows. There are no rules when it comes to removing columns from an existing database table. Simply edit the table and remove a row. (Of course, you will lose the data expressed in those columns for all existing rows.)

Adding new columns to an existing database table without any rows is just as simple: Go into the table editor, add the new column(s), and save the results. This process is a little trickier if the table has existing rows because the database table must decide what values to place into the new column(s) for the existing rows. Here, you have two options: You can either have the new column(s) allow Nulls, or you can specify a default value for the column. (You can set the default value through the Column Properties pane.) If you specify a default value for the new column(s), all existing rows will have the default value inserted for the new column(s). If you do not specify a default value, but instead elect to allow Nulls, then the new column(s) for the existing rows will have a value of Null.




Sams Teach Yourself ASP. NET 2.0 in 24 Hours, Complete Starter Kit
Sams Teach Yourself ASP.NET 2.0 in 24 Hours, Complete Starter Kit
ISBN: 0672327384
EAN: 2147483647
Year: 2004
Pages: 233

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net