Search columns in SQL Server 2005 database

This post was written by namwar on April 26, 2007
Posted Under: Uncategorized

Since SQL Server 2005 Management Studio lacks the Object Search feature, here is the simple query to find any column in a database

Select O.name objectName, C.name ColumnName from sys.columns C inner join sys.objects O ON C.object_id=O.object_idwhere C.name like ‘%ColumntoFind%’order by O.name,C.name

This query works for SQL Server 20005. Just replace “ColumnToFind” with your required column name.

Reader Comments

This is exactly what I needed! Thank you!!!!

#1 
Written By 2Pac on September 29th, 2008 @ 9:05 pm

thanks for the query.

#2 
Written By Raj on December 22nd, 2009 @ 8:56 am

Add a Comment

required, use real name
required, will not be published
optional, your blog address