May 2, 2012

sp_MSadd_replmergealert (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_MSadd_replmergealert(int @agent_type
, int @agent_id
, int @error_id
, int @alert_error_code
, nvarchar @publisher
, nvarchar @publisher_db
, nvarchar @publication
, int @publication_type
, nvarchar @subscriber
, nvarchar @subscriber_db
, nvarchar @article
, nvarchar @destination_object
, nvarchar @source_object
, ntext @alert_error_text)

MetaData:

 CREATE PROCEDURE sys.sp_MSadd_replmergealert   
(
@agent_type int,
@agent_id int,
@error_id int,
@alert_error_code int,
@publisher sysname,
@publisher_db sysname,
@publication sysname,
@publication_type int,
@subscriber sysname,
@subscriber_db sysname,
@article sysname,
@destination_object sysname,
@source_object sysname,
@alert_error_text ntext
)
AS
begin
declare @retcode int

SET NOCOUNT ON

exec @retcode = sys.sp_MScheck_pull_access
@agent_id = @agent_id,
@agent_type = 1 -- merge agent
if @@error <> 0 or @retcode <> 0
return (1)

INSERT INTO msdb.dbo.sysreplicationalerts (status, agent_type , agent_id, error_id, alert_error_code, time, publisher,
publisher_db, publication, publication_type, subscriber, subscriber_db,
article, destination_object, source_object, alert_error_text)
VALUES (0, @agent_type, @agent_id, @error_id, @alert_error_code, getdate(), @publisher,
@publisher_db, @publication, @publication_type, @subscriber, @subscriber_db,
@article, @destination_object, @source_object, @alert_error_text)

IF @@ERROR <> 0
BEGIN
RETURN (1)
END

return (0)
end

No comments:

Post a Comment

Total Pageviews