April 25, 2012

sp_help_agent_default (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_default(int @agent_type)

MetaData:

 create procedure sys.sp_help_agent_default (  
@profile_id int OUTPUT,
@agent_type int
)
as
begin
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 @agent_type not in (1, 2, 3, 4, 9)
BEGIN
RAISERROR(20058, 16, -1)
return (1)
END

select @profile_id = profile_id
from msdb.dbo.MSagent_profiles
where agent_type = @agent_type
and def_profile = 1
end

No comments:

Post a Comment

Total Pageviews