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

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Generating Random String
 New Topic  Reply to Topic
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 09/19/2006 :  17:59:46  Show Profile  Reply with Quote
Originally posted by PSamsig

It works in 2005, no dublicates, but i guess that isnt a surprise. I find it scary though, that TOP 100 PERCENT actually affects the query plan ... isnt that a bug in it self?

-- The Heisenberg uncertainty principle also applies when debugging

It's good to hear that it works OK in 2005.

It caused me some real trouble over here:
Random Integer, Sample, and Datetime Functions

Go to Top of Page

Constraint Violating Yak Guru

384 Posts

Posted - 09/19/2006 :  18:23:13  Show Profile  Send PSamsig a Yahoo! Message  Reply with Quote
Sorry I hadnt read that tread before, or I would have tested it earlier. The bright side of it is that you can now answer Arnold, your original approach is portable between 2000 and 2005, and his isnt

-- The Heisenberg uncertainty principle also applies when debugging
Go to Top of Page

Starting Member

1 Posts

Posted - 12/11/2012 :  15:47:43  Show Profile  Reply with Quote
How could I use this code in a loop to insert a unique random value into each row of the table.
Go to Top of Page

Flowing Fount of Yak Knowledge

2873 Posts

Posted - 12/12/2012 :  07:42:54  Show Profile  Reply with Quote
I wouldn't do this in a loop

UPDATE yourTable
SET yourColumn = rand(checksum(newid()))


Everyday I learn something that somebody else already knew
Go to Top of Page

Starting Member

1 Posts

Posted - 12/17/2012 :  03:07:07  Show Profile  Reply with Quote
thank you for your posts

Edited by - Law2son8 on 12/17/2012 03:07:57
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Previous Page
 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.06 seconds. Powered By: Snitz Forums 2000