I thought that select fieldname from tablename order by newid()
Would bring back random record(s) in random order in MS SQL Server. ---------------------- Galen M. Smallen VP, CTO ZoeMed, Inc. mailto:[EMAIL PROTECTED] http://www.zoemed.com > >-----Original Message----- > >From: [EMAIL PROTECTED] > >[mailto:[EMAIL PROTECTED] On Behalf Of Schreck, Tom > >Sent: Wednesday, January 05, 2005 7:17 AM > >To: [email protected] > >Subject: RE: Random Number Generator... > > > > > >Why not place a unique constraint on your companyID field in > >your database? Do you need to randomly select a company from > >your company table? If so, I have a cool way of doing that > >via a SQL Select statement. > > > >Thanks > > > >Tom Schreck > >972-361-9943 > > > >-----Original Message----- > >From: Alford, Gary L [mailto:[EMAIL PROTECTED] > >Sent: Wednesday, January 05, 2005 7:10 AM > >To: DFW ColdFusion Users Group (E-mail) > >Subject: Random Number Generator... > > > >I am currently running a random number generator and > >assigning it to a variable as follows: > > > > <cfset CompanyId = #LCase(Left(form.CompanyName,2))# & > >#RandRange(100, 999)#> > > > >The problem is that there will always be the possibility of > >duplication. I would like to run a <cfquery... to extract > >the Company IDs from the table in order to double check for > >duplication. If a duplication is found, how can I cause the > >random number generator to run again and recheck for > >duplication without reloading the entire page? > > > > _____ > > > >Gary L. Alford > >Manufacturing Operations Project Specialist > >Bell Helicopter XWorx > >Phone: (817) 280-6233 Fax: (817) 278-6233 > >[EMAIL PROTECTED] > ><mailto:[EMAIL PROTECTED]> > > > >I have not failed. I've found 10,000 ways that won't work. > > Thomas A. Edison > > _____ > > > >---------------------------------------------------------- > >To post, send email to [email protected] > >To unsubscribe: > > http://www.dfwcfug.org/form_MemberUnsubscribe.cfm > >To subscribe: > > http://www.dfwcfug.org/form_MemberRegistration.cfm > > > >---------------------------------------------------------- > >To post, send email to [email protected] > >To unsubscribe: > > http://www.dfwcfug.org/form_MemberUnsubscribe.cfm > >To subscribe: > > http://www.dfwcfug.org/form_MemberRegistration.cfm > > > > ---------------------------------------------------------- To post, send email to [email protected] To unsubscribe: http://www.dfwcfug.org/form_MemberUnsubscribe.cfm To subscribe: http://www.dfwcfug.org/form_MemberRegistration.cfm
