Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSupdate_subscriber_tracer_history

  No additional text.


Syntax

-- Name:
--		sp_MSupdate_subscriber_tracer_history

-- Description:
--		This procedure will update the MStracer_history row's subscriber_commit
--		time to getdate().

-- Parameters:
--		@parent_tracer_id	int				tracer id of the parent
--		@subscriber			sysname			subscriber server name
--		@subscriber_db		sysname			subscriber database

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

-- Result:
--		None

-- Security:
--		Sysadmin/dbo/pal (run by distribution agent)

create procedure sys.sp_MSupdate_subscriber_tracer_history
(
	@parent_tracer_id	int,
	@agent_id			int
)
as
begin
    set nocount on

    declare @retcode 		int,
    		@current_date	datetime

	select @current_date = getdate()
	
    -- security check
    exec @retcode = sys.sp_MScheck_pull_access @agent_id = @agent_id, @agent_type = 0
    if @@error <> 0 or @retcode <> 0
    begin
        return 1
    end
	
	begin transaction tr_sp_MSupd_sub_tracer_hist
	save transaction tr_sp_MSupd_sub_tracer_hist
	
	-- here we will update the subscriber commit time
	-- if the tracer history row no longer exists then
	-- we will exit with no error because this may happen
	-- if cleanup comes bye and removes the history row
	update MStracer_history
		set subscriber_commit = @current_date
		where parent_tracer_id = @parent_tracer_id
			and agent_id = @agent_id
	if @@error <> 0
		goto Err_Handler

	commit transaction tr_sp_MSupd_sub_tracer_hist
	return 0

Err_Handler:
	rollback transaction tr_sp_MSupd_sub_tracer_hist
	commit transaction

	return 1
end

 
Last revision 2008RTM
See also

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