June 6, 2012

sp_publication_validation (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_publication_validation(nvarchar @publication
, smallint @rowcount_only
, tinyint @full_or_fast
, bit @shutdown_agent
, nvarchar @publisher)

MetaData:

   
CREATE PROCEDURE sys.sp_publication_validation
(
@publication sysname, -- publication name --
@rowcount_only smallint = 1, -- type of check requested --
@full_or_fast tinyint = 2, -- full (0) fast (1), or conditional fast (2) method to calculate rowcount --
@shutdown_agent bit = 0, -- shut down agent after validation if 1 --
@publisher sysname = NULL -- only non-null for heterogeneous publishers --
)
AS
BEGIN
DECLARE @cmd nvarchar(4000)
DECLARE @retcode int
DECLARE @publisher_type sysname

SET @retcode = 0


-- Security Check
-- No reason anyone but Sysadmin or dbo of publishing db should run this
exec @retcode = sys.sp_MSreplcheck_publish
if @@error <> 0 or @retcode <> 0
begin
return (1)
end

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

IF @retcode <> 0
RETURN (@retcode)

if (@publisher_type = 'MSSQLSERVER')
begin

SET @cmd = @cmd + N'dbo.sp_MSpublication_validation '

EXEC @retcode = @cmd
@publication,
@rowcount_only,
@full_or_fast,
@shutdown_agent

end
else
begin
-- Heterogeneous articles are handled directly by sp_IHpublication_validation
SET @publisher = UPPER(@publisher) COLLATE DATABASE_DEFAULT
set @cmd = @cmd + N'sys.sp_IHpublication_validation '

EXEC @retcode = @cmd
@publication,
@rowcount_only,
@full_or_fast,
@shutdown_agent,
@publisher
end

RETURN (@retcode)
END

No comments:

Post a Comment

Total Pageviews