Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_cdc_drop_change_table_objects

  No additional text.


Syntax
create procedure [sys].[sp_cdc_drop_change_table_objects]
(
	@capture_instance sysname
)
as
begin
	declare @change_table nvarchar(1000)
		,@fn_all_changes nvarchar(1000)
		,@fn_net_changes nvarchar(1000)
		,@stmt nvarchar(1000)
		,@sp_insdel_proc nvarchar(1000)
		,@sp_upd_proc nvarchar(1000)
		,@sp_batchinsert_proc nvarchar(1000)
		,@object_id int
		
    set nocount on
		
	set @change_table   = N'[cdc].' + quotename( @capture_instance + N'_CT')
	set @object_id      = object_id(@change_table)
	set @fn_all_changes = N'[cdc].' + quotename( N'fn_cdc_get_all_changes' +  N'_' + @capture_instance)
	set @fn_net_changes = N'[cdc].' + quotename( N'fn_cdc_get_net_changes' +  N'_' + @capture_instance)
	set @sp_insdel_proc = N'[cdc].' + quotename( N'sp_insdel_' + convert(nvarchar(10),@object_id) )
	set @sp_upd_proc    = N'[cdc].' + quotename( N'sp_upd_' + convert(nvarchar(10),@object_id) )
	set @sp_batchinsert_proc    = N'[cdc].' + quotename( N'sp_batchinsert_' + convert(nvarchar(10),@object_id) )
	
	if object_id (@fn_all_changes, 'IF') is not null
	begin
		set @stmt = N'drop function ' + @fn_all_changes
		exec (@stmt)
	end
		
	if object_id (@fn_net_changes, 'IF') is not null
	begin
		set @stmt = N'drop function ' + @fn_net_changes
		exec (@stmt)
	end
	
	if object_id (@sp_upd_proc, 'P') is not null
	begin
		set @stmt = N'drop procedure ' + @sp_upd_proc
		exec (@stmt)
	end

	if object_id (@sp_insdel_proc, 'P') is not null
	begin
		set @stmt = N'drop procedure ' + @sp_insdel_proc
		exec (@stmt)
	end
		
	if object_id (@sp_batchinsert_proc, 'P') is not null
	begin
		set @stmt = N'drop procedure ' + @sp_batchinsert_proc
		exec (@stmt)
	end
	
	if object_id (@change_table, 'U') is not null
	begin
		set @stmt = N'drop table ' + @change_table
		exec (@stmt)
	end	

    return 0
end

 
Last revision 2008RTM
See also

  sp_cdc_disable_table_instance (Procedure)
sp_cdc_logddl_internal (Procedure)
sp_MSdrop_cdc (Procedure)
       



News

  Query a named instance
Sybase+ASE+silent+install
SQL 2008 R2
Deprecated procedures in SQL2008
Reporting Services item-level role definitions
Create all your missing indexes
Converting datetime field
Start MSSQL Server Profiler at time
Replicating MSSQL Server views
Exploring Microsoft Sharepoint
The OLE DB provider "SQLNCLI10" for linked server indicates.
Mobile solar charger
Oracle to SQL Server replication
Cannot insert the value NULL into column
Undocumented Microsoft SQL Server 2008
VMware
Zoekmachine optimalisatie
SQL Servers hidden objects
FckEditor
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
PHP
sIFR; de combinatie tussen HTML en Flash