Is their any other way or sql
query to find the database table names with a particular column than shown below,
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = 'NameID'
USE YourDatabseName GO 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.
A feature that can be used to search for column names in SQL Server is Object search. This feature allows users to find all SQL objects containing the specified phrase.
In SQL Server, you can query sys.columns
.
Something like:
SELECT t.name FROM sys.columns c inner join sys.tables t on c.object_id = t.object_id WHERE c.name = 'NameID'
You might want an additional lookup to resolve the schema name, if you have tables in multiple schemas.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With