0% found this document useful (0 votes)
126 views1 page

Find Column in All Tables - SQL SERVER

This document provides instructions for finding all tables in a SQL Server database that use a particular column. The query selects the table and column names from the Information_Schema.columns view where the column name matches the one being searched for. It also recommends using the sp_depends stored procedure to list all database objects like procedures, views, and triggers that reference a given table or view.

Uploaded by

Fenil Desai
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
126 views1 page

Find Column in All Tables - SQL SERVER

This document provides instructions for finding all tables in a SQL Server database that use a particular column. The query selects the table and column names from the Information_Schema.columns view where the column name matches the one being searched for. It also recommends using the sp_depends stored procedure to list all database objects like procedures, views, and triggers that reference a given table or view.

Uploaded by

Fenil Desai
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

HOW TO: Get list of all tables where a particular column has been used in SQL Server

#SQLTIPS #SQLQUERY #SQLINTERVIEWQUESTIONS #SQL2005 #SQLSERVER Select Table_Name, Column_Name From Information_Schema.columns Where Column_Name = 'columnnametoearch' HOW to get dependencies of any table or view in SQL: sp_depends table/viewname This will list all the database objects stored procedures, views, triggers where that table has been used.

You might also like