Saving recordset to a table

Results 1 to 2 of 2

Thread: Saving recordset to a table

  1. #1
    kevin Guest

    Default Saving recordset to a table

    I have a large disconnected recordset that I want to save to a SQL table. The only solution I have so far is to create a new table and loop through the recordset, appending each record using addnew. This however is a extremely slow method.<BR><BR>Is there a way to connect the recordset to a new table and save it with an updatebatch command? It seems it should be possible but I have been unsuccesful in my attempts. Sample code of how to do this would be extremely helpful.<BR><BR>Thanks.

  2. #2
    BS Guest

    Default RE: Saving recordset to a table

    I suppose the following code will work<BR><BR>&#060;%<BR>dim cnnDB,rsEmployees<BR>set cnnDB=Server.CreateObject("ADODB.Connection")<BR>s et rsEmployees=Server.CreateObject("ADODB.Recordset") <BR><BR> "WorkforceDB","sa",""<BR><BR>&#039update the main database<BR>rsEmployees.ActiveConnection=cnnDB<BR> rsEmployees.UpdateBatch<BR><BR>&#039Close the connection and recordset<BR><BR>cnnDB.Close<BR>rsEmployees.Close< BR><BR>%&#062;<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts