Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSupgrade_merge_history90

  No additional text.


Syntax
create procedure sys.sp_MSupgrade_merge_history90
as
begin
	-- If the MSmerge_history table is in the pre-Yukon format, transfer data from it to MSmerge_sessions
	if object_id('MSmerge_history') is not NULL and object_id('MSmerge_sessions') is not NULL
		and exists (select * from sys.columns
									where name = 'publisher_insertcount' and object_id=object_id('MSmerge_history'))
	begin
		
		delete from dbo.MSmerge_history where timestamp not in
			(select max(timestamp) from dbo.MSmerge_history group by agent_id)
			
		-- transfer as much of old history into new tables as possible.
		exec ('insert into dbo.MSmerge_sessions (agent_id, start_time, end_time, duration, delivery_time, delivery_rate, percent_complete,
			upload_inserts, upload_updates, upload_deletes, upload_conflicts, download_inserts, download_updates, download_deletes,
			download_conflicts, runstatus)
		select agent_id, start_time, time, duration, delivery_time, delivery_rate, 100,
			subscriber_insertcount, subscriber_updatecount, subscriber_deletecount,	subscriber_conflictcount,
			publisher_insertcount, publisher_updatecount, publisher_deletecount, publisher_conflictcount,
			runstatus
		from dbo.MSmerge_history')
								
		IF exists (select * from sys.columns
				where name = 'session_id'
				and object_id=object_id('MSrepl_errors'))
			and exists (select * from sys.columns
				where name = 'error_id'
				and object_id=object_id('MSmerge_history'))
        begin
			exec ('update e set e.session_id = s.session_id
			from dbo.MSrepl_errors e join dbo.MSmerge_history h
			on e.id = h.error_id
			join dbo.MSmerge_sessions s
			on h.agent_id = s.agent_id')
        end
    end

	return 0
	
end

 
Last revision 2008RTM
See also

  sp_MScreate_common_dist_tables (Procedure)
sp_vupgrade_distdb (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