sys.sp_cdc_generate_wrapper_function (Transact-SQL)
Generuje skrypty tworzenia otoki funkcji dla funkcji kwerendy przechwytywania danych zmian, które są dostępne w SQL Server. Interfejs API, który jest obsługiwany w wygenerowanym otoki umożliwia interwał kwerendy należy określić interwał daty/godziny.Dzięki temu funkcja dobre do użycia w wielu aplikacjach magazynowania, łącznie z tymi, które są opracowywane przez Integration Services Załaduj pakiet projektantów, którzy wykorzystują technologię przechwytywania danych zmian do określenia przyrostowych.
sys.sp_cdc_generate_wrapper_function
[ [ @capture_instance sysname = ] 'capture_instance'
[ , [ @closed_high_end_point = ] closed_high_end_pt
[ , [ @column_list = ] 'column_list'
[ , [ @update_flag_list = ] 'update_flag_list'
Argumenty
[@ capture_instance =] ' capture_instance"
Is the capture instance that scripts are to be generated for.capture_instance is sysname and has a default value of NULL.W przypadku pominięcia wartości lub jawnie zestaw wartość null, otoka generowane są skrypty dla wszystkich wystąpień przechwytywania[@ closed_high_end_point =] high_end_pt_flag
Is the flag bit that indicates whether changes that have a commit time equal to the high endpoint are to be included within the extraction interval by the generated procedure.high_end_pt_flag is bit and has a default value of 1, which indicates that the endpoint should be included.Wartość 0 oznacza, że cały czas transakcji będzie ściśle mniej niż wysokie punktu końcowego.[@ column_list =] ' column_list"
Is a list of captured columns to be included in the result set that is returned by the wrapper function.column_list is nvarchar(max) and has a default value of NULL.Jeśli określona została wartość NULL, wszystkie kolumny przechwyconych są uwzględniane.[@ update_flag_list =] ' update_flag_list"
Is a list of included columns for which an update flag is included in the result set that is returned by the wrapper function.update_flag_list is nvarchar(max) and has a default value of NULL.Jeśli określona została wartość NULL, flagi aktualizacji nie są uwzględniane.
Wartości kodów powrotnych
0 (sukces) lub 1 (brak)
Zestawy wyników
Nazwa kolumna |
Typ kolumna |
Description |
---|---|---|
function_name |
nvarchar(145) |
Nazwa funkcja wygenerowany. |
create_script |
nvarchar(max) |
Czy skrypt, który tworzy funkcja otoka wystąpienie przechwytywania. |
Remarks
Zawsze generowany jest skrypt, który tworzy funkcja do kwerendy wszystkie zmiany w przypadku przechwytywania zawijanie.Jeśli wystąpienie przechwytywania obsługuje kwerendy zmiany netto, skrypt, aby wygenerować otoki dla tej kwerendy jest również generatedl.
Przykłady
Poniższy przykład pokazuje sposób korzystania z sys.sp_cdc_generate_wrapper_function Aby utworzyć otoki dla wszystkich zmian danych przechwytywania funkcji.
DECLARE @wrapper_functions TABLE (
function_name sysname,
create_script nvarchar(max));
INSERT INTO @wrapper_functions
EXEC sys.sp_cdc_generate_wrapper_function;
DECLARE @create_script nvarchar(max);
DECLARE #hfunctions CURSOR LOCAL fast_forward
FOR
SELECT create_script FROM @wrapper_functions;
OPEN #hfunctions;
FETCH #hfunctions INTO @create_script;
WHILE (@@fetch_status <> -1)
BEGIN
EXEC sp_executesql @create_script
FETCH #hfunctions INTO @create_script
END;
CLOSE #hfunctions;
DEALLOCATE #hfunctions;
See Also