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
 Transact-SQL (2000)
 Find certain field in the database

Author  Topic 

jonasalbert20
Constraint Violating Yak Guru

300 Posts

Posted - 2007-10-18 : 04:47:47
Does SQL server 2000 have a way to find a certain field in a certain server? returning what database, what table?

Or any related issue?


thanks in advance...




Want Philippines to become 1st World COuntry? Go for World War 3...

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-10-18 : 05:02:54
select * information_schema.columns



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

jonasalbert20
Constraint Violating Yak Guru

300 Posts

Posted - 2007-10-18 : 05:29:29
Thanks!

Want Philippines to become 1st World COuntry? Go for World War 3...
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-10-18 : 05:33:37
Or

EXEC sp_MSforeachdb 'SELECT ''?'' AS [DB], * FROM [?].INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME LIKE ''MyColName'''

Kristen
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-10-18 : 06:49:17
quote:
Originally posted by Kristen

Or

EXEC sp_MSforeachdb 'SELECT ''?'' AS [DB], * FROM [?].INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME LIKE ''MyColName'''

Kristen


Still depending on undocumented sps?

I would run

Select 'select * from '+name+'.INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME LIKE ''id''' from master..sysdatabases

and copy result back to QA and run


Madhivanan

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

Kristen
Test

22859 Posts

Posted - 2007-10-18 : 07:05:33
"Still depending on undocumented sps?"

Aye, but 'tis no worse than depending on master..sysdatabases
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-10-18 : 07:17:05
quote:
Originally posted by Kristen

"Still depending on undocumented sps?"

Aye, but 'tis no worse than depending on master..sysdatabases


I beleive the undocumented sp depends on the same

Madhivanan

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

- Advertisement -