Showing posts with label mysearchtext. Show all posts
Showing posts with label mysearchtext. Show all posts

Monday, March 19, 2012

check field

Hi, how to find out what table, field contain "mysearchtext" in side? Thanks
a lot.Check out the INFORMATION_SCHEMA system views for more info, but here's
something you can use fight now:
select INFORMATION_SCHEMA.[COLUMNS].TABLE_NAME
from INFORMATION_SCHEMA.[COLUMNS]
where (INFORMATION_SCHEMA.[COLUMNS].COLUMN_NAME = 'mysearchtext')
ML
http://milambda.blogspot.com/|||"js" <js@.someone.com> wrote in message
news:eLWFGf1TGHA.2656@.TK2MSFTNGP10.phx.gbl...
> Hi, how to find out what table, field contain "mysearchtext" in side?
> Thanks a lot.
You want to search through all tables and columns?
A combination of the undocumented stored procedure "sp_MSforeachtable",
this statement: select column_name from INFORMATION_SCHEMA.COLUMNS where
table_name = 'tableName'
a cursor,
dynamic SQL
and: select ... from tableName where columnName like '%mysearchtext%'|||Thanks ML,
How about search field content? hwo to do that?
"ML" <ML@.discussions.microsoft.com> wrote in message
news:C744B478-EE78-4378-9528-13106F88443C@.microsoft.com...
> Check out the INFORMATION_SCHEMA system views for more info, but here's
> something you can use fight now:
> select INFORMATION_SCHEMA.[COLUMNS].TABLE_NAME
> from INFORMATION_SCHEMA.[COLUMNS]
> where (INFORMATION_SCHEMA.[COLUMNS].COLUMN_NAME = 'mysearchtext')
>
> ML
> --
> http://milambda.blogspot.com/