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
 Transact-SQL (2000)
 NewId()

Author  Topic 

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2004-06-14 : 10:22:06
hi all!

i'd like to know how each NewId() is calculated and on what parameters??? it's just curiosity, and google gets me nowhere (i'm probably searching wrong :))
an accurate formula would be great.
and what is a chance of it being duplicated. i have an app wich will be installed on over 500 different places (also 500 servers) and not one should be duplicated.



Go with the flow & have fun! Else fight the flow :)

ehorn
Master Smack Fu Yak Hacker

1632 Posts

Posted - 2004-06-14 : 10:29:35
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/acdata/ac_8_con_03_2uox.asp
Go to Top of Page

JasonGoff
Posting Yak Master

158 Posts

Posted - 2004-06-14 : 10:30:22
Search BOL for NewID() - it tells you it returns type of uniqueidentifier.
Search for uniqueidentifier, this is defined as a globally unique identifier (GUID). GUIDs are unique. You won't get the same one twice.
See http://www.webopedia.com/TERM/G/GUID.html.
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2004-06-14 : 10:39:46
thanx all... of course i didn't look for uniqueidentifier... talk about searching wrong :)

Go with the flow & have fun! Else fight the flow :)
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2004-06-14 : 11:16:25
one more question:

it says in MSDN that GUID is calculated based on an uniqueidentifier from a network card. what if a computer doesn't have a network card??

Go with the flow & have fun! Else fight the flow :)
Go to Top of Page
   

- Advertisement -