SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 NEWID()
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

AskSQLTeam
Ask SQLTeam Question

USA
0 Posts

Posted - 12/06/2000 :  09:31:01  Show Profile  Visit AskSQLTeam's Homepage  Reply with Quote
Kyle writes "The company I work for has two SQL servers running SQL 7.0. It is sometimes necessary to use the SQL function NEWID() to get a string of random hexadecimal numbers for one of our applications. On one of the servers, successive calls to the NEWID() function result in completely different output, shown below. However, on the other server, successive calls result in output that is almost exactly the same. Any idea what's going on?

First Server: SQL 7.0, Windows 2000

BE1CFA33-76EB-481B-8252-18F247624C5F
6A3321CF-A237-469F-8EE2-936E7E9770AE
5F326529-2790-4116-9D22-45BCD5CE9792
295E2293-68B5-44CA-BCFB-236959ABEE08

Second Server: SQL 7.0, NT 4.0 SP 5

C9AA6401-BF0E-11D4-9DAA-00805F0D4DB9
C9AA6402-BF0E-11D4-9DAA-00805F0D4DB9
C9AA6403-BF0E-11D4-9DAA-00805F0D4DB9
C9AA6404-BF0E-11D4-9DAA-00805F0D4DB9"

graz
Chief SQLTeam Crack Dealer

USA
4138 Posts

Posted - 12/06/2000 :  09:31:01  Show Profile  Visit graz's Homepage  Reply with Quote
All I can tell you is that NEWID() is guaranteed to be unique, not random or sequential. http://www.sqlteam.com/item.asp?ItemID=283
Go to Top of Page

btrimpop
Posting Yak Master

USA
214 Posts

Posted - 12/06/2000 :  13:09:37  Show Profile  Reply with Quote
From Books Online:

The Transact-SQL NEWID function and the application API functions and methods generate new uniqueidentifier values from the identification number of their network card plus a unique number from the CPU clock. Each network card has a unique identification number; network card manufacturers guarantee that no other network card in the next 100 years will have the same number. The uniqueidentifier returned by NEWID is generated using the network card on the server. The uniqueidentifier returned by application API functions and methods is generated using the network card on the client.



Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000