April 16, 2012

sp_cdc_get_ddl_history (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_get_ddl_history(nvarchar @capture_instance)

MetaData:

 create procedure [sys].[sp_cdc_get_ddl_history]                    
(
@capture_instance sysname
)
as
begin

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

if (@capture_instance is null) or (rtrim(@capture_instance) = N'')
begin
raiserror(22963, 16, -1, N'@capture_instance')
return 1
end

if ([sys].[fn_cdc_has_select_access](rtrim(@capture_instance)) = 0)
begin
raiserror(22981, 16, -1)
return 1
end

exec sys.sp_cdc_ddl_history @capture_instance

return 0
end

No comments:

Post a Comment

Total Pageviews