Click here to Skip to main content
15,891,423 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have 15 tables.

I want to find the ocurences of value in a row of a table.

ex: value='N.A'

I want to find the ocurences of 'N.A' value in one row of the table.

Even the table has 100 column also.

Suppose if ONLY 50th column consists 'N.A' then count value - 1


I need sql query.

Can anyone help me.
Posted
Updated 28-Oct-11 23:27pm
v2
Comments
RaisKazi 29-Oct-11 5:27am    
Edited: Please use "Title Case" while phrasing statements.
Mehdi Gholam 29-Oct-11 6:01am    
Do you want to do this in code or tsql?
Srinivas Kumar Pasumarthi 29-Oct-11 6:02am    
in tsql

1 solution

You can get a list of tables using the sys.tables view, and join on sys.columns to get a list of all columns.

This would probably a good candidate for freetext[^]-query, but that'd require some more preparations.
 
Share this answer
 
Comments
Amir Mahfoozi 31-Oct-11 6:48am    
+5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900