Ask Paula!

...bringing you notes from the field...

  Home  |   Contact  |   Syndication    |   Login
  147 Posts | 5 Stories | 133 Comments | 0 Trackbacks

News

Copyright © 2008-2018 Paula DiTallo

Tag Cloud


Archives

Post Categories

.NET Development

Enterprise Integration

Entertainment - Games

Java Development

Mobile/PDA Development

Professional Affiliations

 

The objects that help you find this info in SQL Server are in sys.tables and sys.columns

SELECT tbl.name AS table_name,
SCHEMA_NAME(schema_id) AS schema_name
,
col.name AS
column_name
FROM sys.tables AS
tbl
INNER JOIN sys.columns col ON tbl.OBJECT_ID = col.
OBJECT_ID
WHERE col.name LIKE
'%YourColumnNameHere%'
ORDER BY schema_name, table_name;

This will bring back every table that has a reference to '%YourColumnNameHere%'

 

posted on Sunday, October 10, 2010 10:27 PM

Feedback

# re: How do I find all instances of a column name in my SQL Server database? 2/19/2016 4:08 AM Anvesh
Nice Article !

Really this will help to people of SQL Server Community.
I have also prepared small note on this, How to find all columns information of SQL Server Database.

http://www.dbrnd.com/2015/10/sql-server-script-to-find-all-columns-information-of-a-database/

Post A Comment
Title:
Name:
Email:
Comment:
Verification: