表與存儲過程關係

select distinct x.name,y.name from
(
select sc.id, sc.text,sj.name from syscomments sc ,sysobjects sj
where patindex('%'+sj.name+'%',sc.text)>0 and sj.type='U'
) x
left join 
(
select distinct a.id, name,text
from syscomments a,sysobjects b    
where a.id=b.id    and b.xtype='p'
) y
 on x.id = y.id
where y.name is not null
order by x.name

發佈了116 篇原創文章 · 獲贊 7 · 訪問量 20萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章