April 16, 2012

sp_articlecolumn (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_articlecolumn(nvarchar @publication
, nvarchar @article
, nvarchar @column
, nvarchar @operation
, bit @refresh_synctran_procs
, bit @ignore_distributor
, int @change_active
, bit @force_invalidate_snapshot
, bit @force_reinit_subscription
, nvarchar @publisher
, bit @internal)

MetaData:

 create procedure sys.sp_articlecolumn (  
@publication sysname, -- The publication name --
@article sysname, -- The article name --
@column sysname = NULL, -- The column name --
@operation nvarchar(5) = N'add' -- Add or delete a column --
-- synctran
, @refresh_synctran_procs bit = 1 -- refresh synctran procs or not
, @ignore_distributor bit = 0
-- DDL
, @change_active int = 0
, @force_invalidate_snapshot bit = 0 -- Force invalidate existing snapshot --
, @force_reinit_subscription bit = 0 -- Force reinit subscription --
, @publisher sysname = NULL
-- Peer-To-Peer
, @internal bit = 0
)
AS
BEGIN
DECLARE @cmd nvarchar(4000)
DECLARE @cmd2 nvarchar(4000)
DECLARE @retcode int
DECLARE @publisher_type sysname
DECLARE @publisher_dbms sysname
DECLARE @publisher_version 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)

SET @publisher = UPPER(@publisher) COLLATE DATABASE_DEFAULT

IF @publisher_type = N'MSSQLSERVER'
BEGIN
-- Add sp
set @cmd = @cmd + N'sys.sp_MSrepl_articlecolumn'

EXEC @retcode = @cmd
@publication,
@article,
@column,
@operation,
@refresh_synctran_procs,
@ignore_distributor,
@change_active,
@force_invalidate_snapshot,
@force_reinit_subscription,
@internal
END
ELSE
BEGIN

-- Set publisher DBMS and version (for getting default data type mapping)
SELECT @publisher_dbms = 'ORACLE'

set @cmd2 = @cmd + N'sys.sp_IHgetversion'
EXEC @retcode = @cmd2
@publisher = @publisher,
@version = @publisher_version OUTPUT

IF @retcode != 0 OR @@ERROR != 0
BEGIN
RETURN (1)
END

-- Add sp
set @cmd2 = @cmd + N'sys.sp_IHarticlecolumn'

EXEC @retcode = @cmd2
@publication,
@article,
@column,
@operation,
@refresh_synctran_procs,
@ignore_distributor,
@change_active,
@force_invalidate_snapshot,
@force_reinit_subscription,
@publisher,
@publisher_type,
@publisher_dbms,
@publisher_version

END

RETURN (@retcode)
END

No comments:

Post a Comment

Total Pageviews