April 13, 2012

sp_addarticle (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_addarticle(nvarchar @publication
, nvarchar @article
, nvarchar @source_table
, nvarchar @destination_table
, nchar @vertical_partition
, nvarchar @type
, nvarchar @filter
, nvarchar @sync_object
, nvarchar @ins_cmd
, nvarchar @del_cmd
, nvarchar @upd_cmd
, nvarchar @creation_script
, nvarchar @description
, nvarchar @pre_creation_cmd
, ntext @filter_clause
, varbinary @schema_option
, nvarchar @destination_owner
, tinyint @status
, nvarchar @source_owner
, nvarchar @sync_object_owner
, nvarchar @filter_owner
, nvarchar @source_object
, nvarchar @auto_identity_range
, bigint @pub_identity_range
, bigint @identity_range
, int @threshold
, bit @force_invalidate_snapshot
, bit @use_default_datatypes
, nvarchar @identityrangemanagementoption
, nvarchar @publisher
, nvarchar @fire_triggers_on_snapshot)

MetaData:

 create procedure sys.sp_addarticle  
(
@publication sysname,
@article sysname,
@source_table nvarchar (386) = NULL,
@destination_table sysname = NULL,
@vertical_partition nchar(5) = N'false',
@type sysname = NULL,
@filter nvarchar (386) = NULL,
@sync_object nvarchar (386) = NULL,
@ins_cmd nvarchar (255) = NULL,
@del_cmd nvarchar (255) = NULL,
@upd_cmd nvarchar (255) = NULL,
@creation_script nvarchar (255) = NULL,
@description nvarchar (255) = NULL,
@pre_creation_cmd nvarchar(10) = N'drop',
@filter_clause ntext = NULL,
@schema_option varbinary(8) = NULL,
@destination_owner sysname = NULL,
@status tinyint = NULL,
@source_owner sysname = NULL,
@sync_object_owner sysname = NULL,
@filter_owner sysname = NULL,
@source_object sysname = NULL,
@artid int = NULL OUTPUT,
@auto_identity_range nvarchar(5) = NULL,
@pub_identity_range bigint = NULL,
@identity_range bigint = NULL,
@threshold int = NULL,
@force_invalidate_snapshot bit = 0,
@use_default_datatypes bit = 1,
@identityrangemanagementoption nvarchar(10) = NULL, -- NONE, MANUAL, AUTO
@publisher sysname = NULL,
@fire_triggers_on_snapshot nvarchar(5) = N'false'
)
AS
BEGIN
set nocount on
DECLARE @cmd nvarchar(4000)
,@retcode int
,@publisher_type sysname

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

IF @retcode <> 0
RETURN (@retcode)

select @publisher = UPPER(@publisher)
,@cmd = @cmd + N'sys.sp_MSrepl_addarticle'

EXEC @retcode = @cmd
@publication,
@article,
@source_table,
@destination_table,
@vertical_partition,
@type,
@filter,
@sync_object,
@ins_cmd,
@del_cmd,
@upd_cmd,
@creation_script,
@description,
@pre_creation_cmd,
@filter_clause,
@schema_option,
@destination_owner,
@status,
@source_owner,
@sync_object_owner,
@filter_owner,
@source_object,
@artid OUTPUT,
@identityrangemanagementoption,
@auto_identity_range,
@pub_identity_range,
@identity_range,
@threshold,
@force_invalidate_snapshot,
@use_default_datatypes,
@publisher,
@publisher_type,
@fire_triggers_on_snapshot

RETURN (@retcode)
END

No comments:

Post a Comment

Total Pageviews