Friday, 26 June 2026     

Login     
 
 Forum Minimize
HomeHomeSQL ServerSQL ServerAdministration ...Administration ...Find column within tables in your databaseFind column within tables in your database
Previous
 
Next
New Post
28/01/2009 11:05 PM
 

The following is a sample script of how to find a column name within all the tables in your database.

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

 
Previous
 
Next
HomeHomeSQL ServerSQL ServerAdministration ...Administration ...Find column within tables in your databaseFind column within tables in your database



    
Terms Of Use   Privacy Statement  
Copyright (c) 2026 Apaloon