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 Administration (2000)
 wildcard

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-04-20 : 09:48:06
Navid writes "I have a database that has approximately 55 tables in it. I need to find all the tables that have any kind of date in it. Is there a way I can search the database where I can ask to show me all the tables that have a column with a 'date' in the name?

Thanks in advance"

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2004-04-20 : 11:50:47
[code]
select table_name, column_name
from information_schema.columns
where column_name like '%date%'
[/code]

best to do this though if you want to find all dates...
[code]
select table_name, column_name
from information_schema.columns
where DATA_TYPE = 'datetime'
[/code]
Go to Top of Page
   

- Advertisement -