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)
 Please test my code. Pretty please!

Author  Topic 

Teroman
Posting Yak Master

115 Posts

Posted - 2002-07-30 : 09:01:52
Hi, can you run the following and post the results, thanks


set nocount on

select @@version

create table #test
(cField char(2))

create table #test2
(cField char(2))

insert into #test2 values('01')
insert into #test2 values('02')
insert into #test2 values('03')
insert into #test2 values('04')
insert into #test2 values('05')
insert into #test2 values('06')
insert into #test2 values('07')
insert into #test2 values('08')
insert into #test2 values('09')

declare @nCount int
select @nCount = 0
while @nCount < 100
begin
insert into #test
select top 1 cField from #test2 order by newid()
select @nCount = @nCount + 1
end

select cField,count(*) from #test group by cField
drop table #test
drop table #test2
set nocount off



the results i get are:

On my Laptop, a PIII 1GHz:


------------------------------------------------------------
Microsoft SQL Server 7.00 - 7.00.623 (Intel X86)
Nov 27 1998 22:20:07
Copyright (c) 1988-1998 Microsoft Corporation
Desktop Edition on Windows NT 5.0 (Build 2195: Service Pack 2)


cField
------ -----------
01 12
02 3
03 13
04 13
05 9
06 12
07 10
08 18
09 10


on the development server, a Dual PIII something-or-other:


--------------------------------------------------------
Microsoft SQL Server 7.00 - 7.00.699 (Intel X86)
May 21 1999 14:08:18
Copyright (c) 1988-1998 Microsoft Corporation
Standard Edition on Windows NT 4.0 (Build 1381: Service Pack 6)


cField
------ -----------
01 97
05 1
06 1
09 1


Have Microsoft broken/fixed newid() somewhere along the line?

thanks for your help

col

PS trim the ------- bit above the version or the formatting of the topic will go all pear shaped :)

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-07-30 : 09:09:02

Microsoft SQL Server 7.00 - 7.00.961 (Intel X86)
Oct 24 2000 18:39:12
Copyright (c) 1988-1998 Microsoft Corporation
Desktop Edition on Windows NT 4.0 (Build 1381: Service Pack 6)


cField
------ -----------
01 9
02 14
03 4
04 12
05 6
06 19
07 17
08 9
09 10

 

Microsoft SQL Server 2000 - 8.00.534 (Intel X86)
Nov 19 2001 13:23:50
Copyright (c) 1988-2000 Microsoft Corporation
Enterprise Edition on Windows NT 5.0 (Build 2195: Service Pack 2)


cField
------ -----------
01 13
02 7
03 5
04 13
05 18
06 9
07 10
08 12
09 13

 



Jay White
{0}
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-07-30 : 09:11:09
There is a difference in the way NT 4.0 and Win2K generate unique identifiers:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=5931
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=2242

Go to Top of Page

Teroman
Posting Yak Master

115 Posts

Posted - 2002-07-30 : 09:16:49
Dear Bill,

Grrrrrrrr!!!

col


*relaxes*

ok, thanks, no further help required, except billg, he will if i ever meet him ;)

Go to Top of Page
   

- Advertisement -