April 22, 2012

sp_dropsubscriber (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_dropsubscriber(nvarchar @subscriber
, nvarchar @reserved
, bit @ignore_distributor
, nvarchar @publisher)

MetaData:

   
create procedure sys.sp_dropsubscriber
(
@subscriber sysname,
@reserved nvarchar(50) = NULL,
@ignore_distributor bit = 0,
@publisher sysname = NULL
)
AS
BEGIN
DECLARE @cmd nvarchar(4000)
DECLARE @retcode int

SET @retcode = 0

-- Security Check: require sysadmin
IF (ISNULL(IS_SRVROLEMEMBER('sysadmin'),0) = 0)
BEGIN
RAISERROR(21089,16,-1)
RETURN (1)
END

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

IF @retcode <> 0
RETURN (@retcode)

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

EXEC @retcode = @cmd
@subscriber,
@reserved,
@ignore_distributor,
@publisher

RETURN (@retcode)
END

No comments:

Post a Comment

Total Pageviews