Database

Find Column In Database

You know the situation - somebody asks you to knock up a quick sql report. The database has been normalised to a large extent. Somewhere in there is a column referring to a customer's name but don't know where or the exact name.... Try this:

SELECT o.name 
FROM sysobjects o
INNER JOIN syscolumns c 
ON c.id = o.id
WHERE c.name like '%ustomer%'