June 6, 2012

sp_processlogshippingmonitorhistory (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_processlogshippingmonitorhistory(tinyint @mode
, uniqueidentifier @agent_id
, tinyint @agent_type
, int @session_id
, tinyint @session_status
, nvarchar @monitor_server
, bit @monitor_server_security_mode
, nvarchar @database
, datetime @log_time
, datetime @log_time_utc
, nvarchar @message)

MetaData:

 create procedure sys.sp_processlogshippingmonitorhistory   
(
@mode tinyint -- 1 = add, 2 = delete
,@agent_id uniqueidentifier
,@agent_type tinyint -- 0 = backup, 1 = copy, 2 = restore
,@session_id int = NULL
,@session_status tinyint = NULL -- 0 = Starting, 1 = Running, 2 = Success, 3 = Error, 4 = Warning
,@monitor_server sysname
,@monitor_server_security_mode bit
,@database sysname = NULL -- needed for add
,@log_time datetime = NULL
,@log_time_utc datetime = NULL
,@message nvarchar(4000) = NULL -- should this be nvarchar(4000) since linked server may not process (max)
)
as
begin
set nocount on
declare @retcode int

--
-- security check
--
exec @retcode = sys.sp_MSlogshippingsysadmincheck
if (@retcode != 0 or @@error != 0)
return 1
--
-- This should be called only on the remote monitor server
--
if (@monitor_server is null or upper(@monitor_server) != upper(@@servername))
return 0
--
-- must be invoked from MSDB
--
if (db_name() != N'msdb')
begin
raiserror (21482, 16, -1, N'sp_processlogshippingmonitorhistory', N'msdb')
return 1
end
--
-- call the internal proc now
--
exec @retcode = sys.sp_MSprocesslogshippingmonitorhistory
@mode = @mode
,@agent_id = @agent_id
,@agent_type = @agent_type
,@session_id = @session_id
,@session_status = @session_status
,@monitor_server = @monitor_server
,@monitor_server_security_mode = @monitor_server_security_mode
,@database = @database
,@log_time = @log_time
,@log_time_utc = @log_time_utc
,@message = @message
if (@retcode != 0 or @@error != 0)
return 1
--
-- all done
--
return 0
end

No comments:

Post a Comment

Total Pageviews