Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Article Discussions
»
Article Discussions by Author
»
Discuss content posted by Chris Nowicki
»
Random problems
58 posts, Page 6 of 6
««
«
2
3
4
5
6
Random problems
Rate Topic
Display Mode
Topic Options
Author
Message
christian_nowicki
christian_nowicki
Posted Wednesday, June 10, 2009 8:58 PM
Forum Newbie
Group: General Forum Members
Last Login: Friday, March 11, 2011 8:48 AM
Points: 2,
Visits: 3
Peso (6/9/2009)
And it's also well established that
ABS(CHECKSUM(NEWID())) % 100
gives random numbers between 0 and 99 with very high, good and even distribution.
I like this solution - it is simpler than the one I proposed.
Post #732724
Jeff Moden
Jeff Moden
Posted Wednesday, June 10, 2009 9:35 PM
SSC-Dedicated
Group: General Forum Members
Last Login: Yesterday @ 8:21 PM
Points: 32,893,
Visits: 26,765
christian_nowicki (6/10/2009)
Peso (6/9/2009)
And it's also well established that
ABS(CHECKSUM(NEWID())) % 100
gives random numbers between 0 and 99 with very high, good and even distribution.
I like this solution - it is simpler than the one I proposed.
Well done, Chris! Takes a hell of a good person to say such a thing in the discussion of their own article. There should be more like you.
--Jeff Moden
"
RBAR
is pronounced "ree-bar" and is a "Modenism" for "
R
ow-
B
y-
A
gonizing-
R
ow".
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #732732
benoit.rocco
benoit.rocco
Posted Thursday, June 11, 2009 5:30 AM
Forum Newbie
Group: General Forum Members
Last Login: Thursday, December 15, 2011 4:04 AM
Points: 4,
Visits: 12
Hello, I've found this article very interesting but I can't find the Row_Number() function. Is it part of SQL Server 2k8 (I've only 2k5) ?
Post #732934
SwePeso
SwePeso
Posted Thursday, June 11, 2009 5:44 AM
SSCrazy
Group: General Forum Members
Last Login: Monday, May 06, 2013 1:26 PM
Points: 2,359,
Visits: 3,292
ROW_NUMBER() was introduced with SQL Server 2005 and need the compatibiity level set to 90 or higher.
N 56°04'39.16"
E 12°55'05.25"
Post #732943
benoit.rocco
benoit.rocco
Posted Thursday, June 11, 2009 3:08 PM
Forum Newbie
Group: General Forum Members
Last Login: Thursday, December 15, 2011 4:04 AM
Points: 4,
Visits: 12
Thank you very much for your answer but I already found the response. I deleted my message but apparently it didn't work.
Post #733371
Jeff Moden
Jeff Moden
Posted Thursday, June 11, 2009 9:19 PM
SSC-Dedicated
Group: General Forum Members
Last Login: Yesterday @ 8:21 PM
Points: 32,893,
Visits: 26,765
benoit.rocco (6/11/2009)
Thank you very much for your answer but I already found the response. I deleted my message but apparently it didn't work.
Cool. Tell us what it was. Two way street here.
--Jeff Moden
"
RBAR
is pronounced "ree-bar" and is a "Modenism" for "
R
ow-
B
y-
A
gonizing-
R
ow".
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #733482
benoit.rocco
benoit.rocco
Posted Saturday, June 13, 2009 5:06 AM
Forum Newbie
Group: General Forum Members
Last Login: Thursday, December 15, 2011 4:04 AM
Points: 4,
Visits: 12
I was using SQL Server Management Studio, but connected to a SQL2000 server, it's for that reason the function ROW_NUMBER() didn't exist ^^
Post #734307
Jeff Moden
Jeff Moden
Posted Saturday, June 13, 2009 11:08 AM
SSC-Dedicated
Group: General Forum Members
Last Login: Yesterday @ 8:21 PM
Points: 32,893,
Visits: 26,765
benoit.rocco (6/13/2009)
I was using SQL Server Management Studio, but connected to a SQL2000 server, it's for that reason the function ROW_NUMBER() didn't exist ^^
Ah... thank you Benoit. That would certainly do it.
--Jeff Moden
"
RBAR
is pronounced "ree-bar" and is a "Modenism" for "
R
ow-
B
y-
A
gonizing-
R
ow".
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #734381
« Prev Topic
|
Next Topic »
58 posts, Page 6 of 6
««
«
2
3
4
5
6
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.