May 24, 2012

sp_MSmerge_getgencount (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_MSmerge_getgencount(varchar @genlist)

MetaData:

 create procedure sys.sp_MSmerge_getgencount  
@genlist varchar(8000),
@gencount int output
as
declare @position1 int
declare @position2 int

set @gencount = 0

if len(@genlist) = 0 or @genlist is NULL
return

-- determine number of generations in genlist
-- if we get this far, we have at least one gen
set @gencount = 1
set @position1 = 1
set @position2 = charindex(',', @genlist, @position1)

while @position2 > 0
begin
set @gencount = @gencount + 1
set @position1 = @position2 + 1
set @position2 = charindex(',', @genlist, @position1)
end

return 0

No comments:

Post a Comment

Total Pageviews