Column Name Search

|

An extension of Table/View Column Information

In the event that you need to find a table that has a specific column name.

SELECT
	t.name AS table_name,
	SCHEMA_NAME(schema_id) AS schema_name,
	c.name AS column_name
FROM
	sys.tables AS t
	INNER JOIN sys.columns c ON t.OBJECT_ID = c.OBJECT_ID
WHERE
	c.name LIKE '%requestNumber%'
ORDER BY
	schema_name,
	table_name;
Originally Posted on February 25, 2013
Last Updated on February 8, 2016
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.