| Author |
Topic |
|
thiyait
Yak Posting Veteran
70 Posts |
Posted - 2006-11-06 : 09:17:10
|
| Hi all,i have a two database and n number similar tables with some field differencei would have list of all tables which contain matched and non matched fields like as Tablename Database_1 field Database_2 fieldAny one help me to solve the problemThanks in advance |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-11-06 : 09:18:10
|
| Do you care of the length of varchar columns has been changed?Peter LarssonHelsingborg, Sweden |
 |
|
|
thiyait
Yak Posting Veteran
70 Posts |
Posted - 2006-11-06 : 09:36:33
|
| i want to compare both of database table fields throught name not the datatype |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
thiyait
Yak Posting Veteran
70 Posts |
Posted - 2006-11-06 : 09:47:06
|
| Hi Peso,Thanks for the replay i m in the need of single query for compare all tables in two databases for similar table name in both sidei want the list like followsTable name Database_1 fields Database_2 fields--------------------------------------------------------Table1 name nameTable1 null Address Table1 city nullTable1 state state Table2....Above field comparision only through fieldname not through datatypes |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-11-06 : 09:53:31
|
| Why is it important with "a single query"?Peter LarssonHelsingborg, Sweden |
 |
|
|
thiyait
Yak Posting Veteran
70 Posts |
Posted - 2006-11-06 : 10:03:01
|
| Hi Peso, For my scenario i need the single query for resultThanks in advance |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-11-06 : 10:09:32
|
| You have to use the query in the function above and use a FULL JOIN between the two databases.Peter LarssonHelsingborg, Sweden |
 |
|
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
Posted - 2006-11-06 : 10:20:23
|
will this help?Select a.Table_Name,A.Column_Name,B.Table_Name,b.Column_Name From at_06112006.information_schema.columns a full outer join information_schema.columns b on a.Table_Name = b.Table_Name and A.Column_Name = B.Column_Name Chiraghttp://chirikworld.blogspot.com/ |
 |
|
|
|