存儲過程包含
select name
from sysobjects o, syscomments s
where o.id = s.id
and text like '%請輸入你要查詢的內(nèi)容%'
and o.xtype = 'P'
表包含
SELECT t.name AS table_name,
c.name AS column_name
FROM? sys.tables AS t
INNER JOIN sys.columns c ON t.OBJECT_ID = c.OBJECT_ID
WHERE c.name LIKE'%請輸入你要查詢的內(nèi)容%'
視圖包含
select name,case when o.xtype = 'V' then '視圖' when o.xtype = 'P' then '存儲過程' when o.xtype = 'T' then '表' else '其他' end as '類型'
from sysobjects o, syscomments s
where o.id = s.id
and text like '%請輸入你要查詢的內(nèi)容%'
and o.xtype IN( 'V','P','T') ORDER BY 類型