May 15, 2012

sp_MSgetmaxsnapshottimestamp (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_MSgetmaxsnapshottimestamp(int @agent_id)

MetaData:

 create procedure sys.sp_MSgetmaxsnapshottimestamp  
(
@agent_id int = NULL,
@timestamp timestamp output
)
as
set nocount on

declare @retcode tinyint

-- this proc is called over the admin link
if (is_srvrolemember('sysadmin') <> 1)
begin
raiserror (14126, 11, -1)
return (1)
end

-- Has to be executed from distribution database
if sys.fn_MSrepl_isdistdb (db_name()) != 1
begin
raiserror (21482, 16, -1, 'sp_MSgetmaxsnapshottimestamp', 'distribution')
return 1
end

if @agent_id is NULL
begin
select @timestamp = max(timestamp) from MSsnapshot_history
end
else
begin
select @timestamp = max(timestamp) from MSsnapshot_history where agent_id = @agent_id
end

if @timestamp is NULL
select @timestamp = 0x00000

No comments:

Post a Comment

Total Pageviews