May 2, 2012

sp_MS_replication_installed (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_MS_replication_installed()

MetaData:

   
--
-- Name: sp_MS_replication_installed
--
-- Descriptions:
--
-- Parameters: as defined in create statement
--
-- Returns: 0 - success
-- 1 - Otherwise
--
-- Security:
-- Requires Certificate signature for catalog access
--
create procedure sys.sp_MS_replication_installed
as
set nocount on
declare @isinstalled int
select @isinstalled = 0
declare @retcode int

EXECUTE @retcode = master.dbo.xp_instance_regread 'HKEY_LOCAL_MACHINE',
'SOFTWARE\Microsoft\MSSQLServer\Replication',
'IsInstalled',
@param = @isinstalled OUTPUT

IF ( @retcode <> 0 ) or ( @@ERROR <> 0 )
begin
raiserror (21028, 16, -1)
return (0)
end

if (@isinstalled is null or @isinstalled = 0)
begin
raiserror (21028, 16, -1)
return (0)
end

return (1)

No comments:

Post a Comment

Total Pageviews