Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_getsqlqueueversion

  No additional text.


Syntax
create procedure sys.sp_getsqlqueueversion
(
    @publisher sysname       -- pubisher - cannot be null
    ,@publisher_db sysname -- publisher_db - cannot be null
    ,@publication sysname    -- publication - cannot be null
    ,@version int output        -- version of the queue > 0
)
as
begin
    set nocount on
    declare @retcode int
                ,@queueidstring sysname

    
    -- Security check
    
    exec @retcode = sp_MSreplcheck_subscribe
    if @@error != 0 or @retcode != 0
        return 1
    
    -- the subscription must be initialized
    
    if exists (select * from sys.objects where name = 'MSsubscription_agents')
    begin
        
        -- do the select for sql queues
        
        select @queueidstring = substring(queue_id, 1, 10)
                 ,@version = cast(substring(queue_id, 12, 10)  as int)
        from dbo.MSsubscription_agents
        where publisher = UPPER(@publisher)
            and publisher_db = @publisher_db
            and publication = @publication
            and update_mode in (4,5)
        if (@queueidstring = N'mssqlqueue')
        begin
            
            -- found the entry
            
            if (@version = 0)
                select @version = 1
        end
        else
        begin
            
            -- No subscription exists
            
            select @version = 0
            return 0
        end
    end
    else
    begin
        
        -- No subscription exists
        
        select @version = 0
        return 0
    end
    
    -- all done
    
    return 0
end

 
Last revision 2008RTM
See also

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