Technical Article

Script to Find, occurence of field in user Tables

,

Enter the name of the field you want to search, in the varchar variable @fieldname al the tables having this particular field will be listed

declare @fieldname varchar(25)
-- Enter the field Name to search
select @fieldname = ''

select  distinct tab.name 
from sysobjects  tab join syscolumns col  on tab.id= col.id 
where tab.xtype ='U'    and col.name  = @fieldname  order by  tab.name

Rate

Share

Share

Rate