May 16, 2012

sp_MSgetrowmetadatalightweight (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_MSgetrowmetadatalightweight(int @tablenick
, uniqueidentifier @rowguid
, uniqueidentifier @pubid)

MetaData:

 create procedure sys.sp_MSgetrowmetadatalightweight  
(@tablenick int,
@rowguid uniqueidentifier,
@type tinyint output,
@rowvector varbinary(11) output,
@changedcolumns varbinary(128) output,
@columns_enumeration tinyint output,
@pubid uniqueidentifier= null)

as
declare @retcode smallint
declare @action tinyint
declare @procname sysname
declare @postfix nchar(32)

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

if (@tablenick is null)
begin
raiserror(14043, 16, -1, '@tablenick', 'sp_MSgetrowmetadatalightweight')
return (1)
end

if (@rowguid is null)
begin
raiserror(14043, 16, -1, '@rowguid', 'sp_MSgetrowmetadatalightweight')
return (1)
end

select @postfix= procname_postfix
from dbo.sysmergearticles
where pubid = @pubid and nickname = @tablenick

set @procname= quotename('MSmerge_lws_sp_multi_' + @postfix)

-- Get the metadata type (and possibly rowvector, changedcolumns) of the row.
exec @retcode= @procname
@action= 3,
@rowguid= @rowguid,
@type= @type output,
@rowvector= @rowvector output,
@changedcolumns= @changedcolumns output,
@columns_enumeration= @columns_enumeration output

if @@error <>0 or @retcode <> 0 return (1)

return (0)

No comments:

Post a Comment

Total Pageviews