This is a simple query for finding all instances of a column with a particular name along with the table that it belongs to. This will not work on SQL Server 2000.
select sys.objects.name as TableName, sys.columns.name as ColumnName
from sys.columns
inner join sys.objects on sys.objects.object_id = sys.columns.object_id
where sys.columns.name = 'countyid'
Posted
Feb 13 2009, 01:37 AM
by
dacrowlah