June 13, 2012

sp_verifypublisher (Transact-SQL MetaData) Definition

Please note: that the following source code is provided and copyrighted by Microsoft and is for educational purpose only.
The meta data is from an SQL 2012 Server.

I have posted alot more, find the whole list here.

Goto Definition or MetaData

Definition:

sys.sp_verifypublisher(nvarchar @publisher)

MetaData:

   
--
-- Name:
-- sp_verifypublisher
--
-- Description:
-- Verify that publisher state is valid for HREPL
--
-- Returns:
-- 0 == Valid
-- 1 == Error in publisher state
--
-- Security:
-- Internal
--
-- Notes:
-- Used by any routine that wants to validate
-- the state of the HREPL publisher before
-- performing any actions against it.
-- Errors are issued at warning level to allow
-- the calling proc to decide how to handle it.
-- For example, drop procedures would typically
-- choose to ignore the errors since everything
-- is being dropped. Add procedures would tend
-- to error out immediately.
--

CREATE PROCEDURE sys.sp_verifypublisher
(
@publisher sysname
)
AS
BEGIN
DECLARE @retcode int
DECLARE @publisher_type sysname
DECLARE @cmd nvarchar(4000)

-- -- -- -- security check, db_owner
exec @retcode = dbo.sp_MSreplcheck_publish
if @@ERROR <> 0 or @retcode <> 0
return(1)

-- Get publisher information
EXEC @retcode = sys.sp_MSrepl_getpublisherinfo @publisher = @publisher,
@publisher_type = @publisher_type OUTPUT,
@rpcheader = @cmd OUTPUT

IF @retcode <> 0
RETURN (@retcode)

-- Execute provider-specific verification
IF UPPER(@publisher_type) IN ('ORACLE', 'ORACLE GATEWAY')
BEGIN
SET @publisher = UPPER(@publisher) COLLATE DATABASE_DEFAULT
SELECT @cmd = @cmd + 'sys.sp_ORAverifypublisher'
EXEC @retcode = @cmd @publisher
END
ELSE
BEGIN
RAISERROR(21645, 16, -1, @publisher_type)
SET @retcode = 1
END

return @retcode
END

No comments:

Post a Comment

Total Pageviews