May 29, 2012

sp_MSsetlastrecgen (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_MSsetlastrecgen(uniqueidentifier @repid
, bigint @srcgen
, uniqueidentifier @srcguid)

MetaData:

   
CREATE PROCEDURE sys.sp_MSsetlastrecgen
(@repid uniqueidentifier, @srcgen bigint, @srcguid uniqueidentifier)
as
--
-- Check to see if current publication has permission
--
declare @retcode int

exec @retcode = sys.sp_MSrepl_PAL_rolecheck @repid = @repid
if (@retcode <> 0) or (@@error <> 0)
return 1

if (@repid is null)
begin
RAISERROR(14043, 16, -1, '@repid', 'sp_MSsetlastrecgen')
return (1)
end
if (@srcgen is null)
begin
RAISERROR(14043, 16, -1, '@srcgen', 'sp_MSsetlastrecgen')
return (1)
end
if (@srcguid is null)
begin
RAISERROR(14043, 16, -1, '@srcguid', 'sp_MSsetlastrecgen')
return (1)
end
if object_id('MSmerge_contents') is NULL and
object_id('MSmerge_rowtrack') is NULL
begin
RAISERROR(20054 , 16, -1)
return (1)
end

update dbo.sysmergesubscriptions set recgen = @srcgen, recguid = @srcguid
where subid = @repid
IF @@ERROR <>0 return (1)

return (0)

No comments:

Post a Comment

Total Pageviews