A follow up to - Did I use that column before?
by Geoff on Sep.09, 2011, under Coding, SQL
This query will get you all of the tables, columns and column details for a database. You will need to substitute the column name with the name of the column that you are looking for.
SELECT table_name=sysobjects.name,
column_name=syscolumns.name,
datatype=systypes.name,
length=syscolumns.length
FROM sysobjects
JOIN syscolumns ON sysobjects.id = syscolumns.id
JOIN systypes ON syscolumns.xtype=systypes.xtype
WHERE sysobjects.xtype='U'
AND syscolumns.name like '%column name%'
ORDER BY sysobjects.name,syscolumns.colid

