Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 generating a server unique identity and timestamp

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-07-09 : 08:06:11
Ofer writes "hi,

Can you please help me create two functions, i'm out of ideas:

1. Function that returns a different server unique id (integer), each time I execute it (without creating a utility table with identity column and using it).

2. a simular function that returns a timestamp (an order oriented varbinary(8) unique value), each time I execute it.

Thanks

Ofer

eMail: OferBs@nexus.co.il"

setbasedisthetruepath
Used SQL Salesman

992 Posts

Posted - 2002-07-09 : 09:25:12
The short answer to 2) is NEWID().

Why do you want 1)? Generally a server-wide sequence # is not a relational concept; there might be a better way to solve your particular problem.

Jonathan Boott, MCDBA
Go to Top of Page

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-07-09 : 09:25:46
Have you looked at the uniqueidentifier datatype?

<O>
Go to Top of Page
   

- Advertisement -