Just in case you are interested, I compared the 2 methods:

1. Using SP (http://www.4guysfromrolla.com/webtech/081100-1.shtml) to select
and return random row using a temp table.
2. Retrieving entire recordset and selecting random row using CF

getTickCount showed that method 2 was twice as fast. Not sure how much of an
effect the size of the table/data types has on method 1, but Ill probably
stick with CF as it seems to be faster for my purposes.

Thanks for your help.

Andy Hall.



----- Original Message -----
From: "Andy Hall" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, September 03, 2002 4:11 PM
Subject: Re: [ cf-dev ] Slightly OT: Returning a random row from SQL Server


> thanks for the pointers. Ill go check it out
>
>
> ----- Original Message -----
> From: "Rich Wild" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, September 03, 2002 3:52 PM
> Subject: RE: [ cf-dev ] Slightly OT: Returning a random row from SQL
Server
>
>
> > best approach (in my opinion) is this stored procedure:
> >
> > http://www.4guysfromrolla.com/webtech/081100-1.shtml
> >
> > I use it a lot and it works great
> >
> > > -----Original Message-----
> > > From: Andy Hall [mailto:[EMAIL PROTECTED]]
> > > Sent: 03 September 2002 16:03
> > > To: [EMAIL PROTECTED]
> > > Subject: [ cf-dev ] Slightly OT: Returning a random row from
> > > SQL Server
> > >
> > >
> > > Hi,
> > >
> > > I need to retrieve a random row from a table. Although I
> > > could get the whole
> > > recordset and select one in CF, I would prefer to only return
> > > the single row
> > > of data I need.
> > >
> > > Can anyone give me a neat method of getting SQL Server 7 to
> > > get one random
> > > row?
> > >
> > > I have got a random number based on the number of records,
> > > but unless I can
> > > access that row directly (like in CF -
> > > queryname.columnname[x]) then I dont
> > > know of a way to get the row. Does anyone know if I can do this?
> > >
> > > Any help appreciated
> > >
> > > Andy Hall.
> > >
> > >
> > > --
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > For human help, e-mail: [EMAIL PROTECTED]
> > >
> >
> >
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > For human help, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> For human help, e-mail: [EMAIL PROTECTED]
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]


Reply via email to