How to Search Tables and Views for columns
Created: 18 Sep 2012
If you have ever needed to create a report but dont know what table you are looking for this might help you out. In my case I had to find something that had the "Publisher".
To look for columns in view...
USE
Symantec_CMDB
SELECT
V.name AS View_name,
SCHEMA_NAME(schema_id) AS schema_name,
c.name AS column_name
FROM sys.views AS v
INNER JOIN sys.columns c ON v.OBJECT_ID = c.OBJECT_ID
WHERE c.name LIKE '%Publisher%'
ORDER BY schema_name, View_name;
To look for columns in tables...
USE
Symantec_CMDB
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.OBJECT_ID
WHERE c.name LIKE '%Publisher%'
ORDER BY schema_name, table_name;
Blog Entry Filed Under:
Endpoint Management, Endpoint Management Community Blog, Altiris Client Management Suite, ServiceDesk - 7.1, Altiris Client Management Suite - 7.x, Altiris Deployment Solution - 7.x, Altiris Deployment Solution, Altiris IT Asset Management, Altiris Recovery Solution, Altiris Server Management Suite, Helpdesk Solution, IT Management Suite, ServiceDesk, database tables, database view vcomputer, SQL query
The Endpoint Management Community Blog is the perfect place to share short, timely insights including product tips, news and other information relevant to the Endpoint Management community. Any authenticated Connect member can contribute to this blog.