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
 General SQL Server Forums
 New to SQL Server Programming
 Finding a specific column from a database

Author  Topic 

anbrutog
Starting Member

4 Posts

Posted - 2009-04-29 : 05:18:54
Hi all,

I'm in the process of creating some custom crystal reports which involve interfacing with our scheduling system and its SQL 2000 backend. Unfortunately , the easiest way I have of creating new reports is to use some that have been already created. However , these pre-created reports create temporary tables and place the required columns in them. So I wish to use these same columns , but I have no visibility as to which table they came from in the orginal database. So I need to know , given a certain column ( without any clue which table it belongs to.. ) ..can I find out which table it belong to?? Apologies if this may seem a little vague or otherwise lacking in detail, any help would be greatly appreciated as it would go a long way to solving my problem

AB

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-04-29 : 05:22:39
select table_name from information_schema.columns
where column_name='your_col'


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

anbrutog
Starting Member

4 Posts

Posted - 2009-04-29 : 05:50:41
Thanks a million madhivanan , works perfectly , just what I need!!

Anbrutog
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-04-29 : 05:55:39
quote:
Originally posted by anbrutog

Thanks a million madhivanan , works perfectly , just what I need!!

Anbrutog


You are welcome

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -