create procedure sys.sp_MSgetlastrecgen
(@repid uniqueidentifier)
as
declare @retcode int
/*
** do permission checking
*/
exec @retcode = sys.sp_MSrepl_PAL_rolecheck @repid = @repid
if @retcode<>0 or @@ERROR<>0 return (1)
if object_id('MSmerge_contents') is NULL and
object_id('MSmerge_rowtrack') is NULL
begin
RAISERROR(20054 , 16, -1)
return (1)
end
if (@repid is null)
begin
RAISERROR(14043, 16, -1, '@repid', 'sp_MSgetlastrecgen')
return (1)
end
select recgen, recguid from dbo.sysmergesubscriptions where subid = @repid
return (0)