April 25, 2012

sp_help_agent_parameter (Transact-SQL MetaData) Definition

Please note: that the following source code is provided and copyrighted by Microsoft and is for educational purpose only.
The meta data is from an SQL 2012 Server.

I have posted alot more, find the whole list here.

Goto Definition or MetaData

Definition:

sys.sp_help_agent_parameter(int @profile_id)

MetaData:

 --  View all the parameters of a profile from the MSagent_parameters table  
create procedure sys.sp_help_agent_parameter(
@profile_id int = -1
)
as
set nocount on

-- Security Check: Must be sysadmin or the replmonitor
if isnull(is_member(N'replmonitor'),0) = 0 and isnull(is_srvrolemember(N'sysadmin'),0) = 0
begin
RAISERROR(14260,16,-1)
return 1
end

if @profile_id = -1
begin
select profile_id, parameter_name, value
from msdb..MSagent_parameters
order by profile_id, parameter_name
end
else
begin
select profile_id, parameter_name, value
from msdb..MSagent_parameters
where profile_id = @profile_id
order by profile_id, parameter_name
end

No comments:

Post a Comment

Total Pageviews