Search the full database for a particular column

41
Views
1
Answers

Can any one suggest me the SQL Query to Search the whole database which returns all the table name containing particular column name?

edit | flag
William Patrick
Asked on: Jun 16, 2011 at 10:56PM

1 Answers

27
4
27

This Sql query returns all the tables with the specified column name.

SELECT t.name FROM sys.tables t 
        INNER JOIN sys
.columns c ON c.object_id = t.object_id
        WHERE c
.name = 'ColumnName' ORDER BY t.name asc
edit | flag
Gokul A
Answered on: Jun 16, 2011 at 10:58PM

Post your Answer

Search

Welcome to Ask Amoeba!
This is 100% free and interactive site for sharing professional Questions and Answers, Opensource projects, Interview questions.
Learners, beginners, Experts stop and share your knowledge and ideas!

Browse Categories

Browse Tags