I have a SQL Express 2005 Database containing about 40 tables. I have an old VB6 script that runs several queries on the DB. The Script also imports a file from the hard drive, parses the file, then inserts the records as long as the db does not already contain records with that information.
The problem is, the processing done by this script is taking a much longer time than it used to, possibly because the database is becoming so large since the script was originally written.
I am assuming some of the queries I wrote for this program are not optimized.
I am using this style to query the SQL DB:
Then to compare data, I do things like
To set it to a VB variable and then compare it later in the program to another VB variable.
- Is this horribly inefficient? Is there a more optimized way to do this? I am doing SELECTS, UPDATES, INSERTS, JOINS, all of which are done from the VB side using this same style of querying.
- But before I go optimizing all of this, I am wondering if moving to .NET or some other language to accomplish this task (possibly even web based) would be more efficient??
TIA.
The problem is, the processing done by this script is taking a much longer time than it used to, possibly because the database is becoming so large since the script was originally written.
I am assuming some of the queries I wrote for this program are not optimized.
I am using this style to query the SQL DB:
Code:
Dim rsNewOrders As Recordset
Set rsNewOrders = New Recordset
strNewOrdersSQL = "SELECT ordersAll.* FROM ordersAll, ordersNew WHERE ordersNew.[order-id] = ordersAll[order-id]"
With rsNewOrders
.CursorLocation = adUseClient
Call .Open(strNewOrdersSQL, conSQL)
End With
Then to compare data, I do things like
Code:
quantity = rsNewOrders![quantity]
To set it to a VB variable and then compare it later in the program to another VB variable.
- Is this horribly inefficient? Is there a more optimized way to do this? I am doing SELECTS, UPDATES, INSERTS, JOINS, all of which are done from the VB side using this same style of querying.
- But before I go optimizing all of this, I am wondering if moving to .NET or some other language to accomplish this task (possibly even web based) would be more efficient??
TIA.