|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
check fieldHi, 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/ Thanks ML,
How about search field content? hwo to do that? Show quote "ML" <M*@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/ "js" <j*@someone.com> wrote in message You want to search through all tables and columns?news:eLWFGf1TGHA.2656@TK2MSFTNGP10.phx.gbl... > Hi, how to find out what table, field contain "mysearchtext" in side? > Thanks a lot. 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%' |
|||||||||||||||||||||||