Home Microsoft SQL Server DigiMailing iRN Contact


  No additional text.

create procedure sys.sp_MSupdateinitiallightweightsubscription
	@publisher					sysname,
	@publisher_db				sysname,
	@publication_name			sysname,
	@pubid						uniqueidentifier,
	@allow_subscription_copy	bit,
	@retention					int,
	@conflict_logging   		int,
	@status                     int,
	@allow_synctoalternate		bit,
	@replicate_ddl				int,
	@automatic_reinitialization_policy bit
	set nocount on

	declare @retcode int
	-- security check
    exec @retcode = sys.sp_MSreplcheck_subscribe
    if @retcode <> 0 or @@error <> 0 return 1
    declare @pubid_local uniqueidentifier

    select @pubid_local = pubid from dbo.sysmergepublications
        where upper(publisher collate SQL_Latin1_General_CP1_CS_AS) = upper(@publisher collate SQL_Latin1_General_CP1_CS_AS) and
			  publisher_db = @publisher_db and
			  name = @publication_name

	update dbo.sysmergepublications
		set pubid=	@pubid,
			retention= @retention,
			status= @status,
            centralized_conflicts= case @conflict_logging
                when 1 then 1
                when 2 then 1
                else 0
            decentralized_conflicts= case @conflict_logging
                when 1 then 0
                when 2 then 1
                else 1
			allow_subscription_copy= @allow_subscription_copy,
			allow_synctoalternate= @allow_synctoalternate,
			replicate_ddl= @replicate_ddl,
			automatic_reinitialization_policy= @automatic_reinitialization_policy
		where pubid = @pubid_local
	if @@error <> 0 return 1

    update dbo.sysmergesubscriptions set pubid= @pubid, replicastate= newid() where pubid = @pubid_local
	if @@error <> 0 return 1

    update dbo.sysmergesubscriptions set subid = @pubid where subid = @pubid_local
	if @@error <> 0 return 1
	update dbo.MSmerge_replinfo set repid = @pubid where repid = @pubid_local
	if @@error <> 0 return 1
	execute @retcode= sys.sp_MSrepl_ddl_triggers @type='merge', @mode='add'
	if @@error <> 0 or @retcode <> 0 return (1)
	return 0

Last revision 2008RTM

  Query a named instance
SQL 2008 R2
Deprecated procedures in SQL2008
Reporting Services item-level role definitions
Create all your missing indexes
Converting datetime field
Start MSSQL Server Profiler at time
Replicating MSSQL Server views
Exploring Microsoft Sharepoint
The OLE DB provider "SQLNCLI10" for linked server indicates.
Mobile solar charger
Oracle to SQL Server replication
Cannot insert the value NULL into column
Undocumented Microsoft SQL Server 2008
Zoekmachine optimalisatie
SQL Servers hidden objects
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
sIFR; de combinatie tussen HTML en Flash