April 16, 2012

sp_cdc_disable_db (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_disable_db()

MetaData:

 create procedure [sys].[sp_cdc_disable_db]  
as
begin
declare @retcode int
,@db_name sysname

-- Verify caller is authorized to disable change data capture for the database
if (isnull(is_srvrolemember('sysadmin'),0) = 0)
begin
raiserror(22902, 16, -1)
return 1
end

-- Verify database is currently enabled for change data capture
if ([sys].[fn_cdc_is_db_enabled]() != 1)
begin
set @db_name = db_name()
raiserror(22901, 10, -1, @db_name)
return 0
end

exec @retcode = sys.sp_cdc_disable_db_internal

if (@@error <> 0) or (@retcode <> 0)
begin
return 1
end

return 0
end

No comments:

Post a Comment

Total Pageviews