Comments and notes on SQL Server 2000, 2005, and T-SQL
It is occasionally necessary to find all the occurrences of a field name in a SQL Server database. This script will seacrh the database and return all the tables that contain a certain field name.
select sysobjects.name
from syscolumns
left join sysobjects on sysobjects.id = syscolumns.id
where syscolumns.name like 'myFieldName'
order by 1
About Steve Gray
Steve is a seasoned (translate: old) developer in VB and ASP.NET. He spends most of his time in Dynamics GP, writing custom mods for consulting firms. Crystal reports, eConnect, VS Tools for Dynamics... anything that comes along.