Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSget_log_shipping_new_sessionid

  No additional text.


Syntax
create procedure sys.sp_MSget_log_shipping_new_sessionid
(
    @agent_id uniqueidentifier      -- primary/secondary ID
    ,@agent_type tinyint                    -- 0 = Backup, 1 = Copy, 2 = Restore
    ,@session_id int output
)
as
begin
    set nocount on
    declare @retcode int
                ,@agent_idstring sysname

    
    -- security check
    
    exec @retcode = sys.sp_MSlogshippingsysadmincheck
    if (@retcode != 0 or @@error != 0)
        return 1
    
    -- validate agent_type
    
    if (@agent_type not in (0,1,2))
    begin
        raiserror(21055, 16, -1, '@agent_type','sp_MSget_log_shipping_new_sessionid')
        return 1
    end
    
    -- validate agent
    
    if (sys.fn_MSvalidatelogshipagentid(@agent_id, @agent_type) = 0)
    begin
        select @agent_idstring = cast(@agent_id as sysname)
        raiserror(32016, 16, 1, @agent_idstring, @agent_type)
        return 1
    end
    
    -- get the current session id
    
    select @session_id = isnull(max(session_id),0) + 1
    from msdb.dbo.log_shipping_monitor_history_detail
    where agent_id = @agent_id and agent_type = @agent_type
    
    -- all done
    
    return 0
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