Home Microsoft SQL Server DigiMailing iRN Contact


  No additional text.


-- Name: sp_scriptpublicationcustomprocs

-- Description: This is a utility procedure for scripting out the
--              article "custom" ins/upd/del procedures for all
--              table articles in a publication with the auto-generate custom
--              procedure schema option enabled. This is particularly useful
--              and in fact specifically designed for setting up no-sync
--              subscriptions.

-- Notes: 1) Reconciliation procedures for concurrent snapshot will
--           not be scripted by this procedure. It does not really make
--           sense to have concurrent snapshots for no-sync subscriptions.
--        2) Custom procedures will not be scripted out for articles
--           without the auto-generate custom procedure (0x2) schema_option.

-- Parameter: @publication sysname

-- Security: Execute permission is granted to public; procedural security
--           check is performed inside the procedure to restrict access
--           to sysadmins and db_owners of current database.

-- Example: exec Northwind.sys.sp_scriptpublicationcustomprocs @publication = N'Northwind'

create procedure sys.sp_scriptpublicationcustomprocs
	@publication	sysname,
	@publisher		sysname = NULL,
    @usesqlclr      bit = 0
	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_scriptpublicationcustomprocs'
	EXEC @retcode = @cmd

	RETURN (@retcode)

raiserror('Creating procedure sp_MSrepl_scriptpublicationcustomprocs',0,-1) with nowait

Last revision 2008RTM
See also

  sp_MSdrop_repltran (Procedure)
sp_MSscriptpublicationcustomprocs (Procedure)


  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