The database queries which object contains what field method statements

  • 2021-12-11 09:23:13
  • OfStack

The database queries which object contains what field statement writing:


select *
from sysobjects o, syscomments s
where o.id = s.id
and text like '%text%'
and o.xtype = 'P'

text is replaced by the field to be looked up

The database queries which object contains the table


select o.name from sys.all_sql_modules s,sysobjects o where definition like '% Table name %' and o.id = s.object_id

Replace the table name with the table name to be looked up


Related articles: