Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

IF i dont know the column name of a table but some part of the name i know, then how to search a column name in sql database.

Regards,
Rahul Agarwal
Posted

SQL
SELECT COLUMN_NAME, TABLE_NAME 
FROM INFORMATION_SCHEMA.COLUMNS 
WHERE COLUMN_NAME LIKE '%name%'


use the same query and replace name in '%name%' with your searching keyword.
 
Share this answer
 
v2
You can use INFORMATION_SCHEMA, see here : http://en.wikipedia.org/wiki/Information_Schema[^]
 
Share this answer
 

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