Updating Tables in Database

Discussion in 'Databases' started by Kaihatsusha, Oct 29, 2009.

  1. Although I'm not yet in this problem, I just thought it would bite me someday.

    When I make a table on my database and at later date decided to update my database by adding table or adding/removing PK/FK relationship, why it doesn't allow the table to be changed and prompts me to just create a new table? I think this will be a big problem if I already deployed my website and at a later date, decided to add one or two columns. If I have to recreate a table, then all the tables requires to be recreated as well (if they have PK/FK relationship to the table you are planning to update).

    Any resolution on this one? Or is it really not allowed in SQL 2008. Didn't encounter such errors on MSSQL 2000 and 2005.
  2. Ray


    This is by design. If you have multiple tables and they all have relationship with each other altering or adding things to them will probably give you some problems. You may need to drop the constraints first. This is why it is so important to plan out the design of your database before hand.
  3. There's a setting in MSSQL 2008 to turn off this notice. It'll drop the tables and recreate them for you with the same data. In SQL Management 2005, this doesn't happen. Just google for it. :)

Share This Page