April 16, 2012

sp_cdc_drop_job (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_cdc_drop_job(nvarchar @job_type)

MetaData:

 create procedure sys.sp_cdc_drop_job  
(
@job_type nvarchar(20)
)
as
begin
set nocount on

declare @retval int
--
-- Authorization check.
--
if (isnull(is_srvrolemember('sysadmin'),0) = 0) and (isnull(is_member('db_owner'),0) = 0)
begin
raiserror(22904, 16, -1)
return(1)
end

-- NOTE: The bit identifying a database as enabled for cdc is
-- cleared before the jobs can be dropped, so only admin
-- authorization is checked here. If this changes, then
-- job security can be checked.
--
-- CDC Job security check
--
-- exec @retcode = [sys].[sp_MScdc_job_security_check]
-- if @retcode <> 0 or @@error <> 0
-- return (1)

set @job_type = rtrim(ltrim(lower(@job_type)))

-- Verify parameter
if ((@job_type is null) or (@job_type not in (N'capture', N'cleanup')))
begin
raiserror(22992, 16, -1, @job_type)
return(1)
end

-- Call internal stored procedure to drop the job
exec @retval = sys.sp_cdc_drop_job_internal
@job_type

if @@error <> 0 or @retval <> 0
return 1

return(0)
end

No comments:

Post a Comment

Total Pageviews