Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_cdc_parse_captured_column_list

  No additional text.


Syntax
create procedure sys.sp_cdc_parse_captured_column_list
(
	@source_schema sysname,
	@source_name sysname,
	@captured_column_list nvarchar(max)
)	
as
begin
	declare @retcode int
		,@column sysname
		,@list nvarchar(max)
		,@object_id int
		,@column_name sysname
		,@column_type sysname
		,@source_table nvarchar(1000)
		,@is_computed bit
		
	declare @captured_columns table
		(
			column_name sysname,
			column_type sysname,
			is_computed bit
		)		

    set nocount on

    set @list = @captured_column_list
    set @column = null
    set @source_table = quotename(@source_schema) + N'.' + quotename(@source_name)
    set @object_id = object_id(@source_table)

    -- Extract one token at a time from the list
    while(@list is not null)
    begin
        -- Split out the next column from the list
		exec @retcode = [sys].[sp_cdc_extract_column] @column output
			,@list output
		
		if (@retcode != 0) or (@@error != 0)
		begin
			return 1
		end
		
		set @column_name = null		

		-- Locate information for the extracted column
		select @column_name = name,
			   @column_type = isnull(type_name(system_type_id), type_name(user_type_id)),
			   @is_computed = is_computed
		from [sys].[columns]
		where object_id = @object_id
		and   name      = @column
		
		if (@column_name is null)
		begin
			raiserror(22930, 16, -1, @column, @source_schema, @source_name)
			return 1 	 	
		end
		
		-- Populate local table with column information
		insert into @captured_columns
		values(@column_name, @column_type, @is_computed)
    end

    -- Generate output result set
    select * from @captured_columns

	return 0
end

 
Last revision 2008RTM
See also

  sp_cdc_enable_table_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