1: USE [AdventureWorksDW2008R2]
2: GO
3: /****** Object: StoredProcedure [sys].[sp_addarticle] Script Date: 02/23/2011 20:01:30 ******/
4: SET ANSI_NULLS OFF
5: GO
6: SET QUOTED_IDENTIFIER OFF
7: GO
8: ALTER procedure [sys].[sp_addarticle]
9: (
10: @publication sysname,
11: @article sysname,
12: @source_table nvarchar (386) = NULL,
13: @destination_table sysname = NULL,
14: @vertical_partition nchar(5) = N'false',
15: @type sysname = NULL,
16: @filter nvarchar (386) = NULL,
17: @sync_object nvarchar (386) = NULL,
18: @ins_cmd nvarchar (255) = NULL,
19: @del_cmd nvarchar (255) = NULL,
20: @upd_cmd nvarchar (255) = NULL,
21: @creation_script nvarchar (255) = NULL,
22: @description nvarchar (255) = NULL,
23: @pre_creation_cmd nvarchar(10) = N'drop',
24: @filter_clause ntext = NULL,
25: @schema_option varbinary(8) = NULL,
26: @destination_owner sysname = NULL,
27: @status tinyint = NULL,
28: @source_owner sysname = NULL,
29: @sync_object_owner sysname = NULL,
30: @filter_owner sysname = NULL,
31: @source_object sysname = NULL,
32: @artid int = NULL OUTPUT,
33: @auto_identity_range nvarchar(5) = NULL,
34: @pub_identity_range bigint = NULL,
35: @identity_range bigint = NULL,
36: @threshold int = NULL,
37: @force_invalidate_snapshot bit = 0,
38: @use_default_datatypes bit = 1,
39: @identityrangemanagementoption nvarchar(10) = NULL, -- NONE, MANUAL, AUTO
40: @publisher sysname = NULL,
41: @fire_triggers_on_snapshot nvarchar(5) = N'false'
42: )
43: AS
44: BEGIN
45: set nocount on
46: DECLARE @cmd nvarchar(4000)
47: ,@retcode int
48: ,@publisher_type sysname
49:
50: EXEC @retcode = sys.sp_MSrepl_getpublisherinfo @publisher = @publisher,
51: @rpcheader = @cmd OUTPUT,
52: @publisher_type = @publisher_type OUTPUT
53:
54: IF @retcode <> 0
55: RETURN (@retcode)
56:
57: select @publisher = UPPER(@publisher)
58: ,@cmd = @cmd + N'sys.sp_MSrepl_addarticle'
59:
60: EXEC @retcode = @cmd
61: @publication,
62: @article,
63: @source_table,
64: @destination_table,
65: @vertical_partition,
66: @type,
67: @filter,
68: @sync_object,
69: @ins_cmd,
70: @del_cmd,
71: @upd_cmd,
72: @creation_script,
73: @description,
74: @pre_creation_cmd,
75: @filter_clause,
76: @schema_option,
77: @destination_owner,
78: @status,
79: @source_owner,
80: @sync_object_owner,
81: @filter_owner,
82: @source_object,
83: @artid OUTPUT,
84: @identityrangemanagementoption,
85: @auto_identity_range,
86: @pub_identity_range,
87: @identity_range,
88: @threshold,
89: @force_invalidate_snapshot,
90: @use_default_datatypes,
91: @publisher,
92: @publisher_type,
93: @fire_triggers_on_snapshot
94:
95: RETURN (@retcode)
96: END