tags:

views:

2077

answers:

1

Is there a way to search for one value (in my case it is a UID of the type char(64)) inside any column of any table inside one MS-SQL database?

I'm sitting in front of a huge database without any idea how the tables had to be linked together. To find that out I'd like to list all tables and there columns that contain a certain value in any row. Is that possible?

One way could be to just dump the entire database into a text file and than use any text-editor to search for the value - but this would be pure pain if the database is too huge.

+3  A: 

Thanks for the question as this is a really useful topic. I will use this myself also now for reasons including the one you put forward. :-)

How to search all columns of all tables in a database for a keyword?

http://vyaskn.tripod.com/search_all_columns_in_all_tables.htm

Andrew

REA_ANDREW
That is an awesome bit of Sql, thanks for finding it for us
MrTelly