Step 1 - SQL Query to search a column name in all tables
SELECT C.NAME[Column Name],O.NAME [Found in Object],
CASE O.XTYPE
WHEN 'U' THEN 'Table'
WHEN 'P' THEN 'Stored Procedure'
WHEN 'FN' THEN 'Scalar Function'
WHEN 'V' THEN 'View'
WHEN 'S' THEN 'System Table'
WHEN 'IT' THEN 'Internal table'
ELSE
'Sysobjects.XTYPE ='''+O.XTYPE +'''' END 'Object Type'
FROM SYSCOLUMNS C
INNER JOIN SYSOBJECTS O ON C.ID=O.ID
AND C.NAME LIKE '%Pass Column Name Here%'
No comments:
Post a Comment