May 14, 2012

sp_MSevaluate_change_membership_for_all_articles_in_pubid (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


sys.sp_MSevaluate_change_membership_for_all_articles_in_pubid(uniqueidentifier @pubid)


create procedure sys.sp_MSevaluate_change_membership_for_all_articles_in_pubid (@pubid uniqueidentifier) as
declare @membership_eval_proc_name nvarchar(130), @retcode int

exec @retcode = sys.sp_MSrepl_PAL_rolecheck @pubid = @pubid
if @retcode<>0 or @@ERROR<>0
return 1

-- get the ArticleChangeMembershipEvaluation proc for each article in this publication.
-- This is different from sp_MSevaluate_change_membership_for_pubid in that it calls the eval procs
-- for the same articles in other publications as well. e.g. if A1 has proc P1 in pub1 and A1 has proc P2
-- in pub2, then we will call both P1 and P2. sp_MSevaluate_change_membership_for_pubid only calls P1.
declare membership_eval_proc_names CURSOR LOCAL FAST_FORWARD FOR select membership_eval_proc_name
from dbo.sysmergepartitioninfoview
where membership_eval_proc_name is not null and membership_eval_proc_name <> ' '
and nickname in (select nickname from dbo.sysmergearticles where pubid = @pubid)

open membership_eval_proc_names

fetch next from membership_eval_proc_names into @membership_eval_proc_name

while (@@fetch_status <> -1)
select @membership_eval_proc_name = 'dbo.' + @membership_eval_proc_name
exec @retcode = @membership_eval_proc_name
if @@error <> 0 or @retcode <> 0
return 1

fetch next from membership_eval_proc_names into @membership_eval_proc_name

close membership_eval_proc_names
deallocate membership_eval_proc_names

return 0

No comments:

Post a Comment

Total Pageviews