Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_cdc_generate_wrapper_function_internal

  No additional text.


Syntax
create procedure [sys].[sp_cdc_generate_wrapper_function_internal]  		
(														
	@closed_high_end_point  bit,
	@column_list            nvarchar(max),
	@update_flag_list		nvarchar(max)
)
with execute as 'dbo'
as
begin
	set nocount on

	declare @object_id int
			,@capture_instance sysname
			,@function_name nvarchar(145)
			,@mapping_option nvarchar(30)
			,@create_script nvarchar(max)
			,@supports_net_changes bit
			
	declare #hinstance cursor local fast_forward for
		select capture_instance, object_id
		from  #capture_instances
		
	if (@closed_high_end_point = 1)
		set @mapping_option = N'largest less than or equal'
	else
		set @mapping_option = N'largest less than'

	open #hinstance
	fetch #hinstance into @capture_instance, @object_id

	while (@@fetch_status <> -1)
	begin
		-- Generate the script to create a wrapper for the all changes function
		set @function_name = N'fn_all_changes_' + @capture_instance
		exec sys.sp_cdc_create_change_enumeration_wrapper_function @capture_instance,
			@function_name, @mapping_option, @column_list, @update_flag_list, @create_script OUTPUT
		
		insert into #create_scripts values(@function_name, @create_script)
			
		-- If the capture instance supports net changes, create a wrapper for the
		-- net changes query function
		if exists (
			select capture_instance from cdc.change_tables
			where capture_instance = @capture_instance
			and supports_net_changes = 1 )
		begin	
			set @function_name = N'fn_net_changes_' + @capture_instance
			exec sys.sp_cdc_create_change_enumeration_wrapper_function @capture_instance,
				@function_name, @mapping_option, @column_list, @update_flag_list, @create_script OUTPUT
		
			insert into #create_scripts values(@function_name, @create_script)
		
		end
		
		fetch #hinstance into @capture_instance, @object_id
	end

	close #hinstance
	deallocate #hinstance
	
	return 0
end																

 
Last revision 2008RTM
See also

  sp_cdc_generate_wrapper_function (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