April 18, 2012

sp_distcounters (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_distcounters()

MetaData:

   
create procedure sys.sp_distcounters
AS

SET NOCOUNT ON

--
-- Declarations.
--
DECLARE @distributor sysname
DECLARE @distribdb sysname
DECLARE @distproc nvarchar (300)
DECLARE @retcode int

--
-- Get distribution server information for remote RPC
-- subscription calls. If no distribution information, assume
-- replication is not being used.
--
EXEC @retcode = sys.sp_MSrepl_getdistributorinfo @rpcsrvname = @distributor OUTPUT,
@distribdb = @distribdb OUTPUT
IF @@error <> 0 OR @retcode <> 0 OR @distributor IS NULL OR
@distribdb IS NULL
RETURN (1)

--
-- Request counters from Distribution Server
--
SELECT @distproc = QUOTENAME(RTRIM(@distributor)) + '.' + QUOTENAME(RTRIM(@distribdb)) +
'.dbo.sp_MSdistribution_counters'
declare @publisher sysname
select @publisher = publishingservername()
EXEC @retcode = @distproc @publisher

No comments:

Post a Comment

Total Pageviews