Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSissnapshotitemapplied

  No additional text.


Syntax

-- Name: sp_MSissnapshotitemapplied

-- Description: This procedure is used by the distribution and the merge
--              agent to determine if a particular snapshot work item
--              has been applied to the subscriber.

-- Notes: This procedure should only be called by the merge agent or the
--        distribution agent at the subscriber database.

-- Parameters: @snapshot_session_token nvarchar(260)
--                - A UniCode string that uniquely identifies a snapshot
--                  delivery session. For now, this will be the snapshot
--                  generation folder of the snapshot being applied.
--             @snapshot_progress_token nvarchar(500)
--                - A UniCode string that uniquely identifies a snapshot
--                  work item.

-- Returns: 0 - succeeded
--          1 - failed

-- Result: This procedure will always return a result set that includes
--         the following column:

--         snapshot_item_applied (int)
--              - 1 if the specified snapshot item is found in
--                MSsnapshotdeliveryprogress
--              - 0 if the specified snapshot item is not found
--                in MSsnapshotdeliveryprogress or
--                MSsnapshotdeliveryprogress simply does not exists.
--         The result set will contain exactly one row.

-- Security: Execute permission of this procedure is granted to public;
--           procedural security check will be performed to make sure
--           that the caller is either a db_owner of the current database
--           or a sysadmin.

create procedure sys.sp_MSissnapshotitemapplied (
    @snapshot_session_token nvarchar(260),
    @snapshot_progress_token nvarchar(500)
    )
as
begin
    set nocount on
    declare @retcode int
    declare @snapshot_progress_token_hash int
    select @retcode = 0

    exec @retcode = sys.sp_MSreplcheck_subscribe
    if @retcode <> 0 or @@error <> 0
    begin
        select @retcode = 1
        goto FAILURE
    end

    if object_id('dbo.MSsnapshotdeliveryprogress') is not null
    begin
        select @snapshot_progress_token_hash =
            sys.fn_repl32bitstringhash(@snapshot_progress_token)
        if @@error <> 0
        begin
            select @retcode = 1
            goto FAILURE
        end
        if exists (select * from MSsnapshotdeliveryprogress
                    where progress_token_hash = @snapshot_progress_token_hash
                      and progress_token = @snapshot_progress_token
                      and session_token = @snapshot_session_token)
        begin
            select 'snapshot_item_applied' = 1
        end
        else
        begin
            select 'snapshot_item_applied' = 0
        end
        if @@error <> 0
        begin
            select @retcode = 1
            goto FAILURE
        end
    end
    else
    begin
        select 'snapshot_item_applied' = 0
    end
    if @@error <> 0
    begin
        select @retcode = 1
        goto FAILURE
    end
FAILURE:
    return @retcode
end

 
Last revision 2008RTM
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