views:

37

answers:

2

Hi Team,

I am using SQL Server 2005. I have a requirement to list out all the tables (and the column) whcih has the value 'xyzeee'.

Is there a query to achieve this?

Thanks

Lijo

A: 

No, wont ever be. This is not doable in one query. You will have to do a LOT of SQL statements in a stored procedure for that.

Is this some homework?

Or - are your requirements more specific than that? I somehow see no sense in this type of query to begin with. I gladly will help you further, but a little more context would be nice.

TomTom
It is not a homework problem. While I executed a query, I got an error as cannot convert 'xxxeee' as INT. So I need to find out which column caused this error. That is the context of this question
Lijo
Well, then why the need to query ALL tables? Dont you have the query that caused the error?
TomTom
THe following answer already helped me
Lijo
+1  A: 

@Lijo. You need to improve your accept rate.

In answer to your question see here http://vyaskn.tripod.com/search_all_columns_in_all_tables.htm

Martin Smith
Thanks. That works. Could you please explain what is "accept rate" and how to improve it?
Lijo
Sure. If you click http://stackoverflow.com/users/275235/lijo you will see the various questions you have asked. If for any of them you received an answer that solved your problem then revisit that answer and click the tick next to it to mark it as answered.
Martin Smith