May 29, 2012

sp_MSsetconflictscript (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_MSsetconflictscript(nvarchar @publication
, nvarchar @article
, nvarchar @conflict_script
, nvarchar @login
, nvarchar @password)

MetaData:

   
-- Add the conflict script pointer to dbo.sysmergearticles - Used by snapshot --
create procedure sys.sp_MSsetconflictscript (
@publication sysname,
@article sysname,
@conflict_script nvarchar(255),
@login sysname =NULL,
@password nvarchar(524) =NULL
) AS

declare @artid uniqueidentifier
declare @pubid uniqueidentifier

--
-- Check for publish permission.
--
declare @retcode int
exec @retcode=sys.sp_MSreplcheck_publish
if @retcode<>0 or @@ERROR<>0 return (1)

select @pubid = pubid from dbo.sysmergepublications where name = @publication and UPPER(publisher)=UPPER(publishingservername()) and publisher_db=db_name()
if @pubid IS NULL
BEGIN
RAISERROR (20026, 16, -1, @publication)
RETURN (1)
END

select @artid = artid FROM dbo.sysmergearticles WHERE name = @article AND pubid = @pubid
if @artid IS NULL
BEGIN
RAISERROR (20027, 16, -1, @article)
RETURN (1)
END

update dbo.sysmergearticles set conflict_script = @conflict_script where artid = @artid and pubid=@pubid
if @@ERROR <> 0
return (1)
return (0)

No comments:

Post a Comment

Total Pageviews