Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Joins on information_schema view

Author  Topic 

scelamko
Constraint Violating Yak Guru

309 Posts

Posted - 2005-08-18 : 15:27:23
Guys,
I am trying to use information_schema view to identify any changes to a column in same table across 2 different schema [vb], [vbdev].

select a.column_name, v.column_name, a.column_default, v.column_default,a.is_nullable, v.is_nullable, a.data_type, v.data_type
from [vb].information_schema.columns as a inner join [vbdev].information_schema.columns as v
on a.table_name = v.table_name
and a.table_name = 'tablea'

I have 67 columns in tablea but I do inner join of information_schema views across [vb], [vbdev] schemas I get a result set of
67*67 = 4489 rows instead 67 rows from both schemas for flat comparisions of the columns.

Any suggestions/ideas ???

Thanks


rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2005-08-18 : 15:34:08
You have to include COLUMN_NAME, and TABLE_SCHEMA in the join as well.

rockmoose
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2005-08-18 : 16:53:58
Don't forget TABLE_CATALOG as well...

EDIT: Why can't we delete these damn things...



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Go to Top of Page

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2005-08-18 : 19:00:49
quote:
Originally posted by X002548

Don't forget TABLE_CATALOG as well...

EDIT: Why can't we delete these damn things...



Delete ?!
You mean the post or from the INFORMATION_SCHEMA views !?!
I can delete my posts when I remember my password...

rockmoose
Go to Top of Page
   

- Advertisement -