May 25, 2012

sp_MSreleaseSlotLock (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_MSreleaseSlotLock(nvarchar @process_name
, nvarchar @DbPrincipal)

MetaData:

   
-- this stored procedure is called by merge agent to release the application lock
-- acquired by sp_MSacquireSlotLock

create procedure sys.sp_MSreleaseSlotLock
@process_name sysname,
@DbPrincipal sysname = N'public'
AS
declare @retcode int

-- Security Checking
-- sysadmin or db_owner or replication agent have access

exec @retcode = sys.sp_MSrepl_PAL_rolecheck
if (@retcode <> 0) or (@@error <> 0)
begin
RAISERROR (14126, 11, -1)
return 1
end

exec @retcode=sys.sp_releaseapplock @process_name,@LockOwner=N'Session',@DbPrincipal=@DbPrincipal
IF (@retcode <> 0)
BEGIN
RAISERROR(21415, 16, -1)
return (1)
END
return @retcode

No comments:

Post a Comment

Total Pageviews