May 8, 2012

sp_MScreate_article_repl_views (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_MScreate_article_repl_views(nvarchar @publication)

MetaData:

   

create procedure sys.sp_MScreate_article_repl_views
@publication sysname
as
declare @pubid uniqueidentifier, @artid uniqueidentifier, @retcode int

-- security check
exec @retcode = sys.sp_MSreplcheck_publish
if @retcode<>0 or @@ERROR<>0
return 1

select @retcode = 0

exec @retcode = sys.sp_MSmerge_validate_publication_presence @publication, NULL, NULL, @pubid output
if @retcode <> 0 or @@error <> 0
return 1

declare artidcursor CURSOR LOCAL FAST_FORWARD FOR
select artid from dbo.sysmergearticles where pubid = @pubid
FOR READ ONLY

open artidcursor
fetch artidcursor into @artid
while (@@fetch_status <> -1)
begin

exec @retcode = sys.sp_MScreate_article_repl_view @pubid, @artid
if @@ERROR<>0 OR @retcode<>0
begin
select @retcode = 1
goto error
end

fetch next from artidcursor into @artid
end

error:
close artidcursor
deallocate artidcursor
return @retcode

No comments:

Post a Comment

Total Pageviews