Question : Automatically create separate tables from an SQL table defined by field value

A recordset has a field 'Language'. Instead of this appearing in the column of the recordset's data table, I would like to have separate tables below each other for each value of the field 'Language'. This is to appear in an ASP webpage, from SQL Server 2000.

Is there an easier way to do this, perhaps a variant of Group By or Rollup etc?

I currently am trying to do in very laborious way:  Recordset1 defines values of Language, and this is the input for Recordset2 within a loop.

Answer : Automatically create separate tables from an SQL table defined by field value

The code included shold do what you need
" rs.movenext loop //if we had records close the table for this language if ll<>"" then response.write "
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
//assuming you have rs as a populated recordset to your SQL Statement and the first order by of the statement is Language
//set last language value
ll=""
//set table definition
tbl=""
do while not rs.eof
  //if the language changes close the last table and create a new one
  if  rs("Language") <>ll then
    //if this is a new language then close the last table
    if ll<>"" then response.write "
hdr
SeasonSingleDouble
" //set the last language ll=rs("Language") //output the table header response.write replace(tbl,"hdr",ll) end if //output a line of data for this record response.write "
" & rs("Season") & "" & rs("Single") & "" & rs("Double") & "
"
Random Solutions  
 
programming4us programming4us