Stephen 

think about it last night why do you

1/ Code the 'generator' using a global table with an identity column
 ie

create proc GetID as
begin
  declare @NewID int
  insert into GenTable (InUse) values ('Y')
  set @NewID = @@identitiy
  return @NewID
end

then call this outside your transaction

-- get id's
exec @NewID1  =  GetID
begin tran
commit

occasionally you could clear the GenTable or use is as a log
or you could supplement your GetID proc with a reuse code to reuse any
ID's not used (not that i'd suggest this)

create proc FreeID @ID integer as
begin
  update GenTable set InUse = 'N' where  GenTableID = @ID
end

and alter GetID to check for possible Free ID's

HTH
Neven

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to