Article View: bit.databases.mssql-l
Article #55Re: Returning Recordsets With Records In Random Order
From: Tomas Tintera
Date: Tue, 22 Feb 2000 00:00
Date: Tue, 22 Feb 2000 00:00
50 lines
2950 bytes
2950 bytes
In Doctor Dobs Journal (approx. January 2000 issue) is prity article and good alghorithm on making card-shuffling. (Random order the array). You can do in in the stored procedure or in the ASP client by JavaScript. Tomas T. Shawn M. Hooper <shawn@smh.on.ca> p�e v diskusn�m p��sp�vku:e_xr4.5037$c7.232905@news1.rdc1.on.wave.home.com... > The only way I can think of doing this off the top of my head is to read > that data from the recordset into an array (does ASP support arrays??) and > then get random numbers from the array to show the data. > > However, this could take up significant amounts of resources depending on > the size of the recordset. > > Just my $.02 > > > > > "Anthony Gatlin" <gatlina@yahoo.com> wrote in message > news:KJqr4.12655$8S2.373870@news1.rdc1.tn.home.com... > > Oh wise ones, > > > > I am writing a web based application that needs to retrieve the records > from > > a query in a random order. Then once the records are "jumbled" the > > application can simply use the vbscript/ADO .movenext and .moveprevious > > methods. I have looked at several options but have found none that work. > The > > Order By Clause appears to only return records in ascending or descending > > order. It would be an absolute last resort to return a recordset and then > > try to randomly jump back and forth within the record set. The recordset > > really needs to be randomized once per session and then remain in the same > > order through multiple passes. > > > > Any advice or hints would be GREATLY appreciated! > > > > Thank you in advance. > > > > Anthony > > > > > >
Technical Details
Message-ID:
<NUkpcRUf$GA.275@dec2000.faf.cuni.cz>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<KJqr4.12655$8S2.373870@news1.rdc1.tn.home.com> <e_xr4.5037$c7.232905@news1.rdc1.on.wave.home.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f816f,f3910254de00620e X-Google-Attributes: gidf816f,public X-Google-Thread: f6611,f3910254de00620e X-Google-Attributes: gidf6611,public X-Google-Thread: 104de1,29c344e57cec3258 X-Google-Attributes: gid104de1,public X-Google-Thread: ff490,f3910254de00620e X-Google-Attributes: gidff490,public X-Google-Thread: 107d2f,f3910254de00620e X-Google-Attributes: gid107d2f,public X-Google-Thread: 11301e,5313a2c849ed4de0 X-Google-Attributes: gid11301e,public X-Google-Thread: f8191,f3910254de00620e X-Google-Attributes: gidf8191,public From: "Tomas Tintera" <t.tintera@gmc.net> Subject: Re: Returning Recordsets With Records In Random Order Date: 2000/02/22 Message-ID: <NUkpcRUf$GA.275@dec2000.faf.cuni.cz> X-Deja-AN: 588416348 References: <KJqr4.12655$8S2.373870@news1.rdc1.tn.home.com> <e_xr4.5037$c7.232905@news1.rdc1.on.wave.home.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Organization: GMC Sotware s.r.o. X-MSMail-Priority: Normal Reply-To: "Tomas Tintera" <t.tintera@gmc.net> Newsgroups: bit.databases.mssql-l,comp.database.ms-sqlserver,comp.databases.ms-sqlserver,cz.comp.microsoft.sql,microsoft.public.sqlserver,microsoft.public.sqlserver.misc,microsoft.public.sqlserver.programming