Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_IHaddpublisher

  No additional text.


Syntax
CREATE PROCEDURE sys.sp_IHaddpublisher
(
	@publisher			sysname,
	@vendor				sysname,
	@distributortimestamp		datetime,
	@publisher_guid 		uniqueidentifier
)
AS
BEGIN
	DECLARE @retcode		int
	DECLARE @publisher_id	smallint
	DECLARE @version		sysname
	
	-- Parameter check: publisher
	
    IF @publisher IS NULL
    BEGIN
        RAISERROR (14043, 16, -1, '@publisher', 'sp_IHaddpublisher')
        RETURN (1)
    END

    EXECUTE @retcode = dbo.sp_validname @publisher

    IF @retcode <> 0
	    RETURN (1)

	
	-- Look up publisher ID
	
	SELECT @publisher_id = svr.srvid
	FROM   master.dbo.sysservers svr
	JOIN   msdb.dbo.MSdistpublishers dist ON svr.srvname = dist.name
	WHERE  UPPER(dist.name collate database_default) = UPPER(@publisher) collate database_default

	IF @@ERROR <> 0
		RETURN (1)

	IF @publisher_id is NULL
	BEGIN
		raiserror(14080, 16, -1, @publisher)
		return (1)
	END

	
	-- Parameter check: @vendor
	
    IF @vendor IS NULL or @vendor NOT IN (N'ORACLE')
    BEGIN
        RAISERROR (21604, 16, -1)
        RETURN (1)
    END

	
	-- Insert publisher
	--	
	INSERT INTO IHpublishers
	(
		publisher_id,
		vendor,
		publisher_guid,
		flush_request_time
	)
	VALUES
	(
		@publisher_id,
		@vendor,
		@publisher_guid,
		@distributortimestamp
	)

	IF @@ERROR <> 0
		return (1)
		
	-- Set version tag by reading it (automatically cached for publisher
	-- types that care)
	EXEC @retcode = sys.sp_IHgetversion	@publisher	= @publisher,
										@version	= @version OUTPUT

	IF @retcode != 0 OR @@ERROR != 0
	BEGIN
		RETURN (1)
	END

	RETURN (0)
END

 
Last revision 2008RTM
See also

  sp_MSdrop_replcom (Procedure)
sp_MSrepl_adddistpublisher (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