May 25, 2012

sp_MSrepl_backup_complete (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_MSrepl_backup_complete()

MetaData:

 create procedure sys.sp_MSrepl_backup_complete  
as
declare @sync_bit int
declare @dist_bit int

set nocount on

set @sync_bit = 32
set @dist_bit = 16

-- security Check
-- BACKUP/RESTORE statements require sysadmin, dbcreator, dbo
if isnull(is_srvrolemember('sysadmin'),0) = 0
and isnull(is_srvrolemember('dbcreator'),0) = 0
and isnull(is_member('db_owner'),0) = 0
begin
raiserror(18799, 16, -1)
return (1)
end

-- If this is a distribution database and it is marked by 'sync with backup'
if exists (select * from master.dbo.sysdatabases where
name = db_name() collate database_default and
category & (@sync_bit | @dist_bit) = @sync_bit | @dist_bit)
begin
update MSrepl_backup_lsns set valid_xact_id = next_xact_id,
valid_xact_seqno = next_xact_seqno
if @@error <> 0
return 1
end

return 0

No comments:

Post a Comment

Total Pageviews