
| Navigation |
|
|
 |
| Latest Additions |
|
|
 |
| Links |
|
 |
| Recommendations |
|
 |
|
ASP - Select Random Records from a data table
By: Lee A. Shurie |
| Subject: |
Database Table |
| Language: |
ASP |
| Rating: |
 Rated 57 times. Rate or review this item: 1 2 3 4 5 Read Reviews
|
Information Many ASP programmers write complicated code to simulate a random selection of items from an open recordset. This is often done by reading all the records into an array, then selecting 10 random records from that array. However, this method is slow and inefficient. Better to use standard features of SQL to select only the number of records needed. This script selects 10 random products from a table named products. It expects that you have already opened a database connection, identified as "c". |
Code
|
Instructions Place this code after you have opened a database connection using "c" as the connection. |
Keywords:random select SQL |
|
|