Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

More Efficient Way to Fill Table?

Status
Not open for further replies.

jennuhw

MIS
Apr 18, 2001
426
US
Is there a more efficient way filling a table than the code I am currently using below?

Code:
tablesql = "CREATE TABLE MyTemptable_" & username & " (order_no varchar(8), customer_part_number char(40), customer_id char(8))"

myConnection.execute tablesql

fillsql = "select order_no, item_id, customer_id, customer_part_number from quote_view"
set fillrs = myconnection.execute(fillsql)

    do while not fillrs.eof
        fillsql = "insert into mytemptable_" & username & " (order_no, customer_part_number, customer_id) values ('" 
        fillsql = fillsql & fillrs.fields("order_no") & "', '" & fillrs.fields("customer_part_number") & "', '" & fillrs.fields("customer_id") & "')"
        myconnection.execute(fillsql)

        fillrs.movenext
    loop
[\code]

Right now, it is timing out, and I need this to be filled as quick as possible.  Thanks.
 
I have created a stored procedure on the SQL server to take care of this for me.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top