April 13, 2012

sp_addlogreader_agent (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_addlogreader_agent(nvarchar @job_login
, nvarchar @job_password
, nvarchar @job_name
, smallint @publisher_security_mode
, nvarchar @publisher_login
, nvarchar @publisher_password
, nvarchar @publisher)

MetaData:

 CREATE PROCEDURE sys.sp_addlogreader_agent   
(
@job_login nvarchar(257) = NULL,
@job_password sysname = NULL,
@job_name sysname = NULL,
@publisher_security_mode smallint = NULL,
@publisher_login sysname = NULL,
@publisher_password sysname = NULL,
@publisher sysname = NULL
)
AS
BEGIN
DECLARE @cmd nvarchar(4000)
DECLARE @retcode int
DECLARE @publisher_type sysname

SET @retcode = 0

EXEC @retcode = sys.sp_MSrepl_getpublisherinfo @publisher = @publisher,
@publisher_type = @publisher_type OUTPUT,
@rpcheader = @cmd OUTPUT

IF @retcode <> 0
RETURN (@retcode)

-- Add sp
SET @publisher = UPPER(@publisher) COLLATE DATABASE_DEFAULT
set @cmd = @cmd + N'sys.sp_MSrepl_addlogreader_agent'

EXEC @retcode = @cmd
@job_login = @job_login,
@job_password = @job_password,
@job_name = @job_name,
@publisher_security_mode = @publisher_security_mode,
@publisher_login = @publisher_login,
@publisher_password = @publisher_password,
@publisher = @publisher,
@publisher_type = @publisher_type

RETURN (@retcode)
END

No comments:

Post a Comment

Total Pageviews