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

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating