|
|
|
SSChampion
        
Group: General Forum Members
Last Login: Friday, May 18, 2007 3:36 PM
Points: 10,040,
Visits: 1
|
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Monday, May 06, 2013 1:26 PM
Points: 2,359,
Visits: 3,292
|
|
One of five orders?
Wouldn't a simple
SELECT TOP 20 PERCENT OrderID FROM Table1 ORDER BY NEWID()
do?
N 56°04'39.16" E 12°55'05.25"
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 8:14 AM
Points: 32,910,
Visits: 26,802
|
|
Steve... I'm not sure what's happened, but this article is all but unreadable. Might look fine from Firefox, but IE8 is having a heck of a time with 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."
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/
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Wednesday, March 06, 2013 12:56 AM
Points: 898,
Visits: 1,045
|
|
Seems this article is also in random order ? 
Wilfred The best things in life are the simple things
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Monday, May 06, 2013 1:26 PM
Points: 2,359,
Visits: 3,292
|
|
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.
N 56°04'39.16" E 12°55'05.25"
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Wednesday, March 06, 2013 3:36 PM
Points: 272,
Visits: 169
|
|
| You have a run-away <pre> block in there after the first result set which is breaking the formatting. (and I didn't expect to have to html encode <)
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Wednesday, August 22, 2012 7:35 PM
Points: 27,
Visits: 62
|
|
Not sure if number of rows matter if this was just for audit purpose I suppose you would not be strict on number of rows.
select * from invoice tablesample (10 percent)
This might work as well.
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Yesterday @ 7:31 AM
Points: 33,
Visits: 243
|
|
| NewID() create a unique ID, but with CHECKSUM it seems cannot guarantee to be unique again.
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 8:08 AM
Points: 16,
Visits: 165
|
|
| I'm with Peso on this one.
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Friday, September 17, 2010 4:24 PM
Points: 23,
Visits: 172
|
|
| The XLeratorDB function library inlcudes a RANDBETWEEN scalar function which works just like the EXCEL RANDBETWEEN function. You could have just included RANDBETWEEN(1, 5) in your select and you would have gotten the results you wanted. You can find out more about this function at http://www.westclintech.com/Documentation/XLeratorDBmathDocumentation/tabid/140/topic/RANDBETWEEN/Default.aspx
|
|
|
|