May 25, 2012

sp_MSreleasesnapshotdeliverysessionlock (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_MSreleasesnapshotdeliverysessionlock()

MetaData:

 --   
-- Name: sp_MSreleasesnapshotdeliverysessionlock
--
-- Description: This procedure is used by the distribution/merge agent to
-- release the application lock acquired through
-- sp_MSacquiresnapshotdeliverysessionlock.
--
-- Returns: 0 - succeeded
-- 1 - failed
--
-- Notes: i) This procedure should be executed by the distribution/merge agent
-- at the subscription database.
--
-- Security: Execute permission of this procedure is granted to public;
-- procedural security check will be performed to make sure
-- that the caller is either a db_owner of the current database
-- or a sysadmin.
--
create procedure sys.sp_MSreleasesnapshotdeliverysessionlock
as
begin
set nocount on
declare @retcode int
declare @resource nvarchar(255)
select @retcode = 0
exec @retcode = sys.sp_MSreplcheck_subscribe
if @retcode <> 0 or @@error <> 0
begin
select @retcode = 1
goto FAILURE
end
select @resource = N'snapshot_delivery_in_progress_' +
db_name() collate database_default
exec @retcode = sys.sp_releaseapplock @Resource = @resource,
@LockOwner = 'Session',
@DbPrincipal = N'db_owner'

if @retcode < 0 or @@error <> 0
begin
select @retcode = 1
goto FAILURE
end
select @retcode = 0
FAILURE:
return @retcode
end

No comments:

Post a Comment

Total Pageviews