Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_MSget_open_gen

  No additional text.


Syntax
create procedure sys.sp_MSget_open_gen
    @art_nick int,
    @max_changes_in_gen int,
    @nickbin varbinary(255),
    @gen bigint output,
    @changes_in_gen int output
as
    declare @target_gen bigint
    declare @changes_in_target_gen bigint
    declare @error int

    select @target_gen = NULL
    if @max_changes_in_gen > 0
        select top 1 @target_gen = generation, @changes_in_target_gen = changecount
            from dbo.MSmerge_genhistory with (readpast, updlock, rowlock)
            where genstatus = 0 and changecount < @max_changes_in_gen and art_nick = @art_nick
    else
        select top 1 @target_gen = generation, @changes_in_target_gen = changecount
            from dbo.MSmerge_genhistory with (readpast, updlock, rowlock)
            where genstatus = 0 and art_nick = @art_nick
    if @target_gen is NULL
    begin
        insert into dbo.MSmerge_genhistory with (rowlock)
            (guidsrc, genstatus, art_nick, nicknames, coldate, changecount)
              values  (newid(), 0, @art_nick, @nickbin, getdate(), 0)
        select @error = @@error, @target_gen = @@identity
        if @error<>0
            return 1
        select @changes_in_target_gen = 0
    end

    select @gen = @target_gen
    select @changes_in_gen = @changes_in_target_gen
    return 0

 
Last revision 2008RTM
See also

  sp_MSdrop_rlcore (Procedure)
sp_MSmovegenzerochanges (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