use the NewID() function

IE:

Create table fred (Globally_Unique_Id uniqueidentifier default NewID() not
null)

will give you a GUID that is unique across everything.

The NewID() function will return a GUID and it will never return the smae
one again.


>I need a bulletproof routine to create unique integer IDs for inserting
rows
>into multiple tables in a MSSQL 7 database.

>The catches are that I want the ID's to be unique in the database, not just
>each table, and the generator must be available to stored procedures.

>Also the generator needs to unaffected by transactions - rollbacks should
>not reset the sequence of values - and the generator must not be locked by
a
>slow transaction.

medge

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