Recent PostsRecent Posts Popular TopicsPopular Topics
 Home Search Members Calendar Who's On

 Random problems Rate Topic Display Mode Topic Options
Author
 Message
 Posted Wednesday, June 10, 2009 8:58 PM
 Forum Newbie Group: General Forum Members Last Login: Tuesday, November 19, 2013 9:14 AM Points: 2, Visits: 4
 Peso (6/9/2009)And it's also well established thatABS(CHECKSUM(NEWID())) % 100gives 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
 Posted Wednesday, June 10, 2009 9:35 PM
 SSC-Dedicated Group: General Forum Members Last Login: Today @ 12:27 AM Points: 34,549, Visits: 28,726
 christian_nowicki (6/10/2009)Peso (6/9/2009)And it's also well established thatABS(CHECKSUM(NEWID())) % 100gives 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 "Row-By-Agonizing-Row".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." "Change is inevitable. Change for the better is not." -- 04 August 2013(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013Helpful Links:How to post code problemsHow to post performance problems
Post #732732
 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
 Posted Thursday, June 11, 2009 5:44 AM
 SSCrazy Group: General Forum Members Last Login: Thursday, December 05, 2013 6:43 AM Points: 2,378, Visits: 3,350
 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
 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
 Posted Thursday, June 11, 2009 9:19 PM
 SSC-Dedicated Group: General Forum Members Last Login: Today @ 12:27 AM Points: 34,549, Visits: 28,726
 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 "Row-By-Agonizing-Row".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." "Change is inevitable. Change for the better is not." -- 04 August 2013(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013Helpful Links:How to post code problemsHow to post performance problems
Post #733482
 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
 Posted Saturday, June 13, 2009 11:08 AM
 SSC-Dedicated Group: General Forum Members Last Login: Today @ 12:27 AM Points: 34,549, Visits: 28,726
 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 "Row-By-Agonizing-Row".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." "Change is inevitable. Change for the better is not." -- 04 August 2013(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013Helpful Links:How to post code problemsHow to post performance problems
Post #734381

 Permissions