Karl Blessing
Programmer
This was also posted in the VB Forum since it deals partly with VB coding, but I seek a SQL Query solution
At the moment I have a small demostration table that has been precreated, it contains about 1,500 records as a demo (the actual table contains over 25,000 records)
anyways the table is setup as so...
SQL Query used to get table is: select * from empdb_bit order by sic2, sic4
Sic2 ¦ Sic4 ¦ latbit ¦ lngbit ¦ ct ¦ id
the goal is of course to create new tables with the names of the Sic2 (like sic02) and each new table (or file as we want to create them into binary files later on) will look like:
Sic4 ¦ Lat ¦ Lng ¦ ID
also the new table format above, must be sorted by Sic4 (which I could probally do just by saying order by Sic4)
at the moment I have this code to identify the different Sic2:
Dim TmpSic As String
Label1.Caption = ""
With Adodc1.Recordset
.MoveFirst
If Not .EOF Then
TmpSic = .Fields("Sic2"
While Not .EOF
If TmpSic <> .Fields("Sic2" Then
Label1.Caption = Label1.Caption & vbCrLf & TmpSic
TmpSic = .Fields("Sic2"
End If
.MoveNext
Wend
Label1.Caption = Label1.Caption & vbCrLf & TmpSic
End If
End With
but it's incredibly slow for the number of records. is there perhaps a SQL Statement, that can least help speed up the process? I am using SQL Server 6.5
At the moment I have a small demostration table that has been precreated, it contains about 1,500 records as a demo (the actual table contains over 25,000 records)
anyways the table is setup as so...
SQL Query used to get table is: select * from empdb_bit order by sic2, sic4
Sic2 ¦ Sic4 ¦ latbit ¦ lngbit ¦ ct ¦ id
the goal is of course to create new tables with the names of the Sic2 (like sic02) and each new table (or file as we want to create them into binary files later on) will look like:
Sic4 ¦ Lat ¦ Lng ¦ ID
also the new table format above, must be sorted by Sic4 (which I could probally do just by saying order by Sic4)
at the moment I have this code to identify the different Sic2:
Dim TmpSic As String
Label1.Caption = ""
With Adodc1.Recordset
.MoveFirst
If Not .EOF Then
TmpSic = .Fields("Sic2"
While Not .EOF
If TmpSic <> .Fields("Sic2" Then
Label1.Caption = Label1.Caption & vbCrLf & TmpSic
TmpSic = .Fields("Sic2"
End If
.MoveNext
Wend
Label1.Caption = Label1.Caption & vbCrLf & TmpSic
End If
End With
but it's incredibly slow for the number of records. is there perhaps a SQL Statement, that can least help speed up the process? I am using SQL Server 6.5