Column Reference in SQL Server

Below script will help to find the column reference in sql server.
 
Select SysObjects.[Name] As [Contraint Name] ,Tab.[Name] as [Table Name],Col.[Name] As [Column Name],*
From
SysObjects Inner Join (Select [Name],[ID] From SysObjects Where XType = 'U') As Tab
On
Tab.[ID] = Sysobjects.[Parent_Obj]
inner
Join sysconstraints On sysconstraints.Constid = Sysobjects.[ID]
where Col.name='UserID' --Column Name
order
by Tab.[Name]
Ebook Download
View all
Learn
View all