データベース内のどのストアド プロシージャにパラメーターがないかを調べたいと考えています。これらを試しましたが、よくわかりません:
1) テーブルsys.all_parameters
との結合sys.all_objects
:
select
ao.name,ao.type, ao.type_desc
from
sys.all_parameters pa
left outer join
sys.all_objects ao
on pa.object_id = ao.object_id
where
pa.name like ''
and
ao.type not in ('FN','AF','FS')
2) 表からinformation_schema.parameters
:
select *
from
information_schema.parameters
where
parameter_mode not in ('in', 'out', 'inout')
3) からinformation_schema.parameters
:
select *
from
information_schema.parameters
where
parameter_name like ''
ただし、これらのいずれかが正しいかどうかは完全にはわかりません。何か直接的な方法はありますか?
たぶん次のようなもの:
select * from sys.procedures where xtype = 'P' and has_parameters=0