How to find all tables having specified column name in a Database


 SELECT s.name AS [Schema],   
      o.name ObjectName,   
      c.name AS ColumnName,   
      t.name AS DataType,   
      o.type_desc AS ObjectType  
 FROM sys.columns c   
      JOIN sys.objects o  
      ON c.object_id = o.object_id  
      JOIN sys.types t  
      ON t.system_type_id = c.system_type_id  
      JOIN sys.schemas s  
      ON s.schema_id = o.schema_id  
 WHERE c.name = '(column_name)'  
      AND t.name = '(data_type)'  


The script will return the result in this format:



Comments