June 7, 2012

sp_replsetoriginator (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_replsetoriginator(nvarchar @originator_srv
, nvarchar @originator_db
, nvarchar @publication)

MetaData:

 create procedure sys.sp_replsetoriginator (  
@originator_srv sysname,
@originator_db sysname,
@publication sysname = NULL
)
as
declare @retcode int
--
-- Security Check, if @publication is supplied, check for PAL, otherwise DBO
--
if @publication is not null
begin
exec @retcode = sys.sp_MSreplcheck_pull @publication = @publication
if @@error <> 0 or @retcode <> 0
begin
return (1)
end
end
else
begin
exec @retcode = sys.sp_MSreplcheck_subscribe
if @@ERROR <> 0 or @retcode <> 0
begin
return(1)
end
end

exec @retcode = sys.sp_replsetoriginator_internal @originator_srv, @originator_db
if @@ERROR <> 0 or @retcode <> 0
begin
return(1)
end

return 0

No comments:

Post a Comment

Total Pageviews