RE: Adding a Column to an existing table

2002-03-27 Thread Jienan Chen
--- Steven Gearhart <[EMAIL PROTECTED]> wrote: > The easiest way to add a column is to get somebody > else to do it. > > Seriously, Use the "ALTER TABLE TableName ADD COLUMN > Company_id INT UNSIGNED > NULL" command. Yes. But also, the company_id field probably should be reset 'not null' AFTER t

Re: Adding a Column to an existing table

2002-03-26 Thread BD
At 02:32 PM 3/26/2002, you wrote: >Hi, I'm new to this list, hopefully, I can contribute some wisdom :) > >At the moment, I have to update a large database to be multi-company-ready, >so I basically have to add a Column "Company_ID" to nearly each table. > >What would be the easiest way to do this

RE: Adding a Column to an existing table

2002-03-26 Thread Steven Gearhart
The easiest way to add a column is to get somebody else to do it. Seriously, Use the "ALTER TABLE TableName ADD COLUMN Company_id INT UNSIGNED NULL" command. This syntax may be found in the MySQL manual in 6.5.4 http://www.mysql.com/doc/A/L/ALTER_TABLE.html ,or page 428 if you have downloaded the

Re: Adding a Column to an existing table

2002-03-26 Thread Brad Visscher
Run the following for each table: ALTER TABLE tableName ADD COLUMN Company_ID INT UNSIGNED NULL; Hope this helps. Ulrik Witschass wrote: >Hi, I'm new to this list, hopefully, I can contribute some wisdom :) > >At the moment, I have to update a large database to be multi-company-ready, >so I

RE: Adding a Column to an existing table

2002-03-26 Thread Andrew Hazen
How are you determining the value to put in the Company_Id field? You can use phpMyAdmin to easily add a column with a default/no null setting to your tables to get you started. (It uses a MODIFY command I believe). If you have the logic for determining the values of Company_ID, you could do as y