Thursday, December 29, 2011

looking for a specific column name in all tables in a database.



SELECT name
FROM sysobjects
WHERE id IN
(
SELECT id
FROM syscolumns
WHERE name like '%thepartofthefieldnameyouarelookingfor%'
)