Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MScheckgenerate_originatorid

  No additional text.


Syntax
create procedure sys.sp_MScheckgenerate_originatorid
(
   @publication sysname,
   @old_originator_id int,
   @new_originator_id int output
)
as
begin
   if @old_originator_id <> 0
   begin
       if exists(select * from dbo.MSpeer_originatorid_history where originator_publication = @publication and originator_id = @old_originator_id )
          select @new_originator_id = 0
       else
          select @new_originator_id = @old_originator_id
       return 0
   end
   else
   begin
       select @new_originator_id = 0

       declare 	@maxposid int,
       		@minnegid int
       select	@maxposid = 0x7fffffff,
       		@minnegid = 0x80000000

       while(1=1)
       begin
           select @new_originator_id = FLOOR(@maxposid * RAND( (DATEPART(mm, GETDATE()) * 100000 )
                                                                                          + (DATEPART(ss, GETDATE()) * 1000 )
                                                                                          + DATEPART(ms, GETDATE())))
		if RAND( (DATEPART(mm, GETDATE()) * 100000 )
                            + (DATEPART(ss, GETDATE()) * 1000 )
                            + DATEPART(ms, GETDATE()))  > 0.5
			select @new_originator_id = @new_originator_id * (-1)

          if @new_originator_id = 0 or @new_originator_id = @minnegid
              continue
          else if exists(select * from dbo.MSpeer_originatorid_history where originator_publication = @publication and originator_id = @new_originator_id)
              continue
          else
              return (0)
       end --while

   end
end

 
Last revision 2008RTM
See also

  sp_configure_peerconflictdetection (Procedure)
sp_MSdrop_repltran (Procedure)
sp_MSrepl_addpublication (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