quickest way to save table data

Smee

Well-Known Member
Licensed User
Longtime User
hi All,

I am writing a program to save sales from a table to a database table. Rather than writing row by row to the database i thought that the following would be quicker.

command.CommandText="Drop Table If Exists TemporaryTable"
Command.ExecuteNonQuery
SQLConn.CreateSQLTable("StblOrders","TemporaryTable")
Command.CommandText = "INSERT INTO Sales SELECT * from TemporaryTable"
Command.ExecuteNonQuery

Can anyone advise if there is a faster way?

Thanks
 

Smee

Well-Known Member
Licensed User
Longtime User
Yes i am using the table control to store the data. then i drop the database temporary table and recreate it from table control and then do an insert into the sales table from the temporary table.

Is this the quickest way? should i initiate a database connection first?
 
Top