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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | 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
 Transact-SQL (2000)
 Generating Random String
 Reply to Topic
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

USA
7020 Posts

Posted - 09/19/2006 :  17:59:46  Show Profile  Reply with Quote
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
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=69499





CODO ERGO SUM
Go to Top of Page

PSamsig
Constraint Violating Yak Guru

Denmark
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

reubenCanowski
Starting Member

USA
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

jimf
Flowing Fount of Yak Knowledge

USA
2875 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()))

Jim

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

Law2son8
Starting Member

USA
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
 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.12 seconds. Powered By: Snitz Forums 2000