Re: Compare two tables

2005-08-26 Thread SGreen
Alfredo Cole [EMAIL PROTECTED] wrote on 08/26/2005 10:07:30 AM: Hi: I need to compare the structure of two tables (fields, field types, field lengths, indices, etc.) to determine if they have the same schema, even if the fields may be in a different order. Is there a command in mysql

Re: Compare two tables

2005-08-26 Thread Martijn Tonies
Hi, I need to compare the structure of two tables (fields, field types, field lengths, indices, etc.) to determine if they have the same schema, even if the fields may be in a different order. Is there a command in mysql that will do this? This will be used to determine if the tables are

RE: Compare two tables

2005-08-26 Thread Gordon Bruce
If you have the 5.0.x version of MySQL then INFROMATION SCHEMA can give you what you want. i.e. SELECT a.*, b.* FROM INFORMATION_SCHEMA.COLUMNS AS a INNER JOIN _SCHEMA.COLUMNS AS b ON (a.column_name = b.column_name) WHERE a.TABLE_NAME = 'foo_1' AND b.TABLE_NAME =

Re: Compare two tables

2005-08-26 Thread Alfredo Cole
El Viernes, 26 de Agosto de 2005 08:16, Martijn Tonies escribió: You could check the table DDL. Or use a third party tool, like Database Workbench, that can do this for you and even generator a change script. Check www.upscene.com With regards, Martijn Tonies Hmmm. No Linux

Re: Compare two tables

2005-08-26 Thread Mark Addison
On Fri, 2005-08-26 at 09:14 -0600, Alfredo Cole wrote: El Viernes, 26 de Agosto de 2005 08:16, Martijn Tonies escribió: You could check the table DDL. Or use a third party tool, like Database Workbench, that can do this for you and even generator a change script. Check

Re: Compare two tables

2005-08-26 Thread Alfredo Cole
El Viernes, 26 de Agosto de 2005 08:56, Gordon Bruce escribió: If you have the 5.0.x version of MySQL then INFROMATION SCHEMA can give you what you want. i.e. SELECT a.*, b.* FROM INFORMATION_SCHEMA.COLUMNS AS a INNER JOIN _SCHEMA.COLUMNS AS b ON (a.column_name =

Re: Compare two tables

2005-08-26 Thread Martijn Tonies
You could check the table DDL. Or use a third party tool, like Database Workbench, that can do this for you and even generator a change script. Check www.upscene.com With regards, Martijn Tonies Hmmm. No Linux version. Thank you anyway. Nope, indeed. Serious answer: too

Re: Compare two tables

2005-08-26 Thread Peter Brawley
Alfredo, If you are using MySQL 5.02 or later, here is an information_schema query that will list table structure _differences_. The idea is to group the UNION of rows in information_schema.columns for the two tables on all information_schema.columns columns, then use HAVING to pick only