April 18, 2012

sp_droparticle (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_droparticle(nvarchar @publication
, nvarchar @article
, bit @ignore_distributor
, bit @force_invalidate_snapshot
, nvarchar @publisher
, bit @from_drop_publication)

MetaData:

   
--
-- Name:
-- sp_droparticle
--
-- Description:
-- Drops an article from a snapshot or transactional publication.
-- An article cannot be removed if one or more subscriptions to it exist.
-- This stored procedure is executed at the Publisher on the publication database.
--
-- Security:
-- Public
--
-- Returns:
-- Success (0) or Failure (1)
--
-- Owner:
-- <current owner>

create procedure sys.sp_droparticle
(
@publication sysname,
@article sysname,
@ignore_distributor bit = 0,
@force_invalidate_snapshot bit = 0,
@publisher sysname = NULL,
@from_drop_publication bit = 0
)
AS
BEGIN
DECLARE @cmd nvarchar(4000)
DECLARE @retcode int
DECLARE @publisher_type sysname

SET @retcode = 0

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

IF @retcode <> 0
RETURN (@retcode)

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

EXEC @retcode = @cmd
@publication,
@article,
@ignore_distributor,
@force_invalidate_snapshot,
@publisher,
@from_drop_publication,
@publisher_type

RETURN (@retcode)
END

No comments:

Post a Comment

Total Pageviews