select
a.name,a.
[
type
]
,b.
[
definition
]
from
sys.all_objects a,sys.sql_modules b
where
a.is_ms_shipped
=
0
and
a.
object_id
=
b.
object_id
and a.
[
type
]
in
(
'
P
'
,
'
V
'
,
'
AF
'
)
order
by
a.
[
name
]
asc
通过这个sql语句可以查到sql server中的视图和存储过程的内容及位置,然后再用where过滤得到,你想要的结果