SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Quickly Generate Random number by TSQL with 99.9% Uniqueness Guarntee


Quickly Generate Random number by TSQL with 99.9% Uniqueness Guarntee

Author
Message
Namwar Rizvi-1153826
Namwar Rizvi-1153826
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 8
Comments posted to this topic are about the item Quickly Generate Random number by TSQL with 99.9% Uniqueness Guarntee
mohit.thakral
mohit.thakral
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 4
I was not able to run the script. I pasted use temdb as first line. I am using SQL Server Management studio 2008 as client and SQL server 2005 as server.

following are the errors that i was getting

Msg 102, Level 15, State 1, Line 10
Incorrect syntax near ' '.
Msg 102, Level 15, State 1, Line 11
Incorrect syntax near ' '.
Msg 102, Level 15, State 1, Line 13
Incorrect syntax near ')'.
Msg 102, Level 15, State 1, Line 17
Incorrect syntax near ' '.
Msg 102, Level 15, State 1, Line 22
Incorrect syntax near ' '.
Msg 208, Level 16, State 1, Line 5
Invalid object name 'tblTest'.
Msg 3701, Level 11, State 5, Line 3
Cannot drop the table 'tblTest', because it does not exist or you do not have permission.
rlwilde
rlwilde
UDP Broadcaster
UDP Broadcaster (1.4K reputation)UDP Broadcaster (1.4K reputation)UDP Broadcaster (1.4K reputation)UDP Broadcaster (1.4K reputation)UDP Broadcaster (1.4K reputation)UDP Broadcaster (1.4K reputation)UDP Broadcaster (1.4K reputation)UDP Broadcaster (1.4K reputation)

Group: General Forum Members
Points: 1447 Visits: 442
Very cool. My results were 1080 duplicate numbers, each appearing twice. No number returned 3 times. Out of 3 million, that's 99.96% unique. :-)
gitmo
gitmo
SSC-Enthusiastic
SSC-Enthusiastic (119 reputation)SSC-Enthusiastic (119 reputation)SSC-Enthusiastic (119 reputation)SSC-Enthusiastic (119 reputation)SSC-Enthusiastic (119 reputation)SSC-Enthusiastic (119 reputation)SSC-Enthusiastic (119 reputation)SSC-Enthusiastic (119 reputation)

Group: General Forum Members
Points: 119 Visits: 187
I had the same issue.
I copied the code into TextPad and got rid of the leading "spaces" within the CTEs. For example, there are 4 characters at the beginning of the line "Select 1 as n" that aren't really spaces.

w00t
Namwar Rizvi-1153826
Namwar Rizvi-1153826
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 8
I checked the issue. This is due to some unprintable characters inserted by HTML. To solve this issue, copy the code in notepad first and you wil see the box for unprintable chracters. Just replace all occurances of that character with a space. After this, Copy the code from notepad and paste it in your Query Analyzer window. It will work like a charm.
Iwas Bornready
Iwas Bornready
SSC-Insane
SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)

Group: General Forum Members
Points: 22424 Visits: 885
Thanks for the script.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search