sp_addpublication_snapshot (Transact-SQL)

Tworzy Agent migawka dla określonej publikacja.Ta procedura przechowywana jest wykonywana przez wydawcę na baza danych publikacja.

Security noteSecurity Note:

Podczas konfigurowania przez wydawcę z dystrybutor zdalny wartości dostarczane dla wszystkich parametrów w tym job_login i job_password, są wysyłane do dystrybutor jako zwykły tekst. Należy zaszyfrować połączenie między Wydawca i jego dystrybutor zdalnym przed wykonaniem tej procedura przechowywana.Aby uzyskać więcej informacji zobacz Encrypting Connections to SQL Server.

Topic link iconKonwencje składni języka Transact-SQL

sp_addpublication_snapshot [ @publication= ] 'publication'
    [ , [ @frequency_type= ] frequency_type ]
    [ , [ @frequency_interval= ] frequency_interval ]
    [ , [ @frequency_subday= ] frequency_subday ]
    [ , [ @frequency_subday_interval= ] frequency_subday_interval ]
    [ , [ @frequency_relative_interval= ] frequency_relative_interval ]
    [ , [ @frequency_recurrence_factor= ] frequency_recurrence_factor ]
    [ , [ @active_start_date= ] active_start_date ]
    [ , [ @active_end_date= ] active_end_date ]
    [ , [ @active_start_time_of_day= ] active_start_time_of_day ]
    [ , [ @active_end_time_of_day= ] active_end_time_of_day ]
    [ , [ @snapshot_job_name = ] 'snapshot_agent_name' ]
    [ , [ @publisher_security_mode = ] publisher_security_mode ]
    [ , [ @publisher_login = ] 'publisher_login' ]
    [ , [ @publisher_password = ] 'publisher_password' ] 
    [ , [ @job_login = ] 'job_login' ]
    [ , [ @job_password = ] 'job_password' ]
    [ , [ @publisher = ] 'publisher' ]

Argumenty

  • [ @publication=] 'publication'
    Is the name of the publication.publication is sysname, with no default.

  • [ @frequency_type=] frequency_type
    Is the frequency with which the Snapshot Agent is executed.frequency_type is int, and can be one of the following values.

    Wartość

    Description

    1

    Tylko raz.

    4 (domyślnie)

    Codzienne.

    8

    Co tydzień.

    16

    Co miesiąc.

    32

    Co miesiąc względem interwał częstotliwości.

    64

    Kiedy SQL Server Agent jest uruchamiany.

    128

    Uruchomić, gdy komputer jest bezczynny

  • [ @frequency_interval=] frequency_interval
    Is the value to apply to the frequency set by frequency_type.frequency_interval is int, and can be one of the following values.

    Wartość frequency_type

    Wpływ na frequency_interval

    1

    frequency_interval jest nieużywany.

    4 (domyślnie)

    Co frequency_interval dni z domyślną codziennie.

    8

    frequency_interval jest co najmniej jedną z następujących czynności (w połączeniu z | (Lub bitowe) operator logiczny):

    1 = Sunday |

    2 = Monday |

    4 = Tuesday |

    8 = Środa |

    16 = Thursday |

    32 = Friday |

    64 = $ Sobota

    16

    Na frequency_interval dzień miesiąca.

    32

    frequency_interval jest jednym z następujących czynności:

    1 = Sunday |

    2 = Monday |

    3 = Tuesday |

    4 = Środa |

    5 = Thursday |

    6 = Friday |

    7 = Saturday |

    8 = Day |

    9 = Weekday |

    10 = dzień wolny

    64

    frequency_interval jest nieużywany.

    128

    frequency_interval jest nieużywany.

  • [ @frequency_subday=] frequency_subday
    Is the unit for freq_subday_interval.frequency_subday is int, and can be one of these values.

    Wartość

    Description

    1

    Tylko raz

    2

    Sekundy

    4 (domyślnie)

    Minuta

    8

    Godziny

  • [ @frequency_subday_interval=] frequency_subday_interval
    Is the interval for frequency_subday.frequency_subday_interval is int, with a default of 5, which means every 5 minutes.

  • [ @frequency_relative_interval=] frequency_relative_interval
    Is the date the Snapshot Agent runs.frequency_relative_interval is int, with a default of 1.

  • [ @frequency_recurrence_factor=] frequency_recurrence_factor
    Is the recurrence factor used by frequency_type.frequency_recurrence_factor is int, with a default of 0.

  • [ @active_start_date=] active_start_date
    Is the date when the Snapshot Agent is first scheduled, formatted as YYYYMMDD.active_start_date is int, with a default of 0.

  • [ @active_end_date=] active_end_date
    Is the date when the Snapshot Agent stops being scheduled, formatted as YYYYMMDD.active_end_date is int, with a default of 99991231, which means December 31, 9999.

  • [ @active_start_time_of_day=] active_start_time_of_day
    Is the time of day when the Snapshot Agent is first scheduled, formatted as HHMMSS.active_start_time_of_day is int, with a default of 0.

  • [ @active_end_time_of_day=] active_end_time_of_day
    Is the time of day when the Snapshot Agent stops being scheduled, formatted as HHMMSS.active_end_time_of_day is int, with a default of 235959, which means 11:59:59 P.M.as measured on a 24-hour clock.

  • [ @snapshot_job_name = ] 'snapshot_agent_name'
    Is the name of an existing Snapshot Agent job name if an existing job is being used.snapshot_agent_name is nvarchar(100) with a default value of NULL.Ten parametr jest do użytku wewnętrznego i nie powinny być określone podczas tworzenia nowej publikacja.Jeśli snapshot_agent_name jest określony, następnie job_login i job_password musi mieć wartość NULL.

  • [ @ publisher_security_mode= ] publisher_security_mode
    Is the security mode used by the agent when connecting to the Publisher.publisher_security_mode is smallint, with a default of 1.0 Określa, SQL Server Uwierzytelnianie, a 1 Określa uwierzytelnianie systemu Windows.Wartość 0 musi być podany dla nie-SQL Server Wydawców. When possible, use Windows Authentication.

  • [ @ publisher_login= ] "publisher_login'
    Is the login used when connecting to the Publisher.publisher_login is sysname, with a default of NULL.publisher_login must be specified when publisher_security_mode is 0.Jeśli publisher_login ma wartość NULL i publisher_security_mode jest 1, a następnie konto określone w job_login używane przy nawiązywaniu połączenia z Wydawca.

  • [ @ publisher_password= ] "publisher_password'
    Is the password used when connecting to the Publisher.publisher_password is sysname, with a default of NULL.

    Security noteSecurity Note:

    Nie należy przechowywać informacje uwierzytelniające w plikach skryptów.W celu poprawienia bezpieczeństwa zaleca się, aby podać nazwy logowania i hasła w czasie wykonywania.

  • [ @ job_login= ] "job_login'
    Is the login for the Windows account under which the agent runs.job_login is nvarchar(257), with a default of NULL.To konto systemu Windows jest zawsze używana dla połączeń agenta do dystrybutor.Ten parametr należy podać podczas tworzenia nowego zadanie agenta migawka.

    Uwaga

    Dla innych niż-SQL Server Wydawcy, musi to być ten sam identyfikator logowania, określonego w sp_adddistpublisher (języka Transact-SQL).

  • [ @ job_password= ] "job_password'
    Is the password for the Windows account under which the agent runs.job_password is sysname, and it has a default of NULL.Ten parametr należy podać podczas tworzenia nowego zadanie agenta migawka.Jeśli użytkownik, który tworzy migawkę jest sysadmin job_password ma wartość NULL, parametr zostaną ustawione wartości domyślne konto używane do uruchamiania programu SQL Server Agent.

    Security noteSecurity Note:

    Nie należy przechowywać informacje uwierzytelniające w plikach skryptów.W celu poprawienia bezpieczeństwa zaleca się, aby podać nazwy logowania i hasła w czasie wykonywania.

  • [ Wydawca @ = ] "publisher'
    Specifies a non-SQL Server Publisher.publisher is sysname, with a default of NULL.

    Uwaga

    publisher nie należy używać podczas tworzenia agenta migawka w SQL Server Wydawca.

Wartości kodów powrotnych

0 (sukces) lub 1 (brak)

Remarks

sp_addpublication_snapshot jest używany w replikacja migawka, replikacji transakcyjnej i replikacja łączenia.

Uprawnienia

Tylko członkowie sysadmin stała rola serwera or db_owner stała rola bazy danych może być wykonywany sp_addpublication_snapshot.