April 22, 2012

sp_dropsubscription (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_dropsubscription(nvarchar @publication
, nvarchar @article
, nvarchar @subscriber
, nvarchar @destination_db
, bit @ignore_distributor
, nvarchar @reserved
, nvarchar @publisher)

MetaData:

   
create procedure sys.sp_dropsubscription
(
@publication sysname = NULL,
@article sysname = NULL,
@subscriber sysname,
@destination_db sysname =NULL, -- If null, all the subscriptions from that subscriber will be dropped
@ignore_distributor bit = 0,
@reserved nvarchar(10) = NULL, -- reserved, used when calling from other system
-- stored procedures, it will be set to 'internal'.
-- It should never be used directly
@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_dropsubscription'

EXEC @retcode = @cmd
@publication,
@article,
@subscriber,
@destination_db,
@ignore_distributor,
@reserved,
@publisher,
@publisher_type

RETURN (@retcode)
END

No comments:

Post a Comment

Total Pageviews