Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_IHdroppublication

  No additional text.


Syntax


-- Name:
--          sp_IHdroppublication

-- Description:
--          HREPL specific logic for sp_droppublication

-- Security:
--          Internal

-- Returns:
--          Success (0) or failure (1)

-- Owner:
--          

CREATE PROCEDURE sys.sp_IHdroppublication
(
	@publication	sysname,
	@publisher		sysname,
	@publisher_type	sysname,
	@ad_guidname	sysname	OUTPUT,
	@logreaderAgent	bit	OUTPUT
)
AS
BEGIN
	DECLARE @retcode int,
			@pubid   int
    /*
    ** Parameter Check: @publication.
    ** The @publication name must conform to the rules for identifiers.
    */

    IF @publication IS NULL
    BEGIN
        RAISERROR (14043, 16, -1, '@publication', 'sp_IHdroppublication')
        RETURN (1)
    END

    
    -- Verify publication exists
    
	SELECT @pubid = sys.fn_MSrepl_getpubid(@publication, @publisher, @publisher_type)

	IF (@pubid IS NULL)
	BEGIN
		RAISERROR (20026, 11, -1, @publication)
		RETURN (1)
	END

    /*
    ** Parameter Check: @publisher.
    ** The @publication name must conform to the rules for identifiers.
    */

    IF @publisher IS NULL
        BEGIN
            RAISERROR (14043, 16, -1, '@publisher', 'sp_IHdroppublication')
            RETURN (1)
        END

    EXECUTE @retcode = dbo.sp_validname @publisher
    IF @retcode <> 0
    RETURN (1)

	
	-- determine if we have a logreader agent
	
   	IF EXISTS (SELECT * FROM IHpublications  where repl_freq = 0)
		SELECT @logreaderAgent = 0
	ELSE
		SELECT @logreaderAgent = 1

	
	-- Get guidname before we delete the publication
	
	SELECT	@ad_guidname = ad_guidname
	FROM	IHpublications
	WHERE	pubid = @pubid

	IF @@ERROR <> 0
		RETURN (1)
	
	-- delete the publication from the distributor
	
	DELETE	IHpublications
  	WHERE	pubid = @pubid

    IF @@ERROR <> 0
   	    RETURN (1)
END

 
Last revision 2008RTM
See also

  sp_MSdrop_repltran (Procedure)
sp_MSrepl_droppublication (Procedure)
       



News

  Query a named instance
Sybase+ASE+silent+install
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
VMware
Zoekmachine optimalisatie
SQL Servers hidden objects
FckEditor
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
PHP
sIFR; de combinatie tussen HTML en Flash