Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find all references to a table column in SQL Server 2008

Is there a way to find all references to a table column in a SQL Server 2008 database? I need to know which other tables or stored procedures or views the column is referenced from.

like image 614
AllSolutions Avatar asked Mar 08 '13 22:03

AllSolutions


People also ask

How do I find all the references to a table in SQL Server?

To view the objects on which a table depends. In Object Explorer, expand Databases, expand a database, and then expand Tables. Right-click a table, and then click View Dependencies.

How do I reference all columns in SQL?

You use column-ref to reference a column (database field), optionally qualified by a table and/or schema name. The column reference comprises the data type of the database field that the column represents (see Data Types).

How can I get column details of a table in SQL?

USE db_name; DESCRIBE table_name; it'll give you column names with the type.

How do I find a particular column name in all tables in SQL Server?

SELECT * FROM INFORMATION_SCHEMA. COLUMNS WHERE COLUMN_NAME LIKE 'PREFIX%' ORDER BY TABLE_NAME; Query: SELECT * FROM INFORMATION_SCHEMA.


1 Answers

If you need to find database objects (e.g. tables, columns, triggers) by name - have a look at the FREE Red-Gate tool called SQL Search which does this - it searches your entire database for any kind of string(s).

enter image description here

enter image description here

It's a great must-have tool for any DBA or database developer - did I already mention it's absolutely FREE to use for any kind of use??

like image 116
marc_s Avatar answered Oct 13 '22 23:10

marc_s