BCStach
BCStach

Reputation: 3

Using DataTables/DataSets in .Net or SQL Tables

I am in the midst of creating a program that reads data from an SQL table, changes it via code in VB, and then stores it. Upon completion of the program, the temporary table is looked at and all rows that have the same email address are aggregated (a Message Column is combined for all those) and a single entry is written to an SQL table that one at a time sends out an email.

Time is of the essence for this program, so the quicker it is done the better.

The question is, should I create a table in SQL to serve as the temporary table, or should I use DataSets/DataTables and keep the Temporary table in memory while hte program is running.

Thanks for your time in advance, Greg

Upvotes: 0

Views: 220

Answers (2)

Conrad Frix
Conrad Frix

Reputation: 52675

I think the driving requirement is how do you want to recover from a failure? Do you reprocess from the beginning or do you want provide a recovery mode?

If you want to start from the beginning an in-memory structure (like a DataSet) is fine. However if you want "pick up from where you left off" you'll need to store your progress in a persistent storage.

In the past I've used a table in a DB to mark the individual successes and failures and included both automatic and manual recovery modes. This enabled me to handle, intermittent, systemic, and single case problems effectively.

Upvotes: 1

gbn
gbn

Reputation: 432667

I'd use a DataTable/DataSet:

  • A SQL Server temp table will require a persistent connection to the database
  • The DataTable/DataSet may "live" for a fairly long time. The SQL Server could reboot itself during this
  • "time is of the essence" means local cache in a DataTable/DataSet

Upvotes: 0

Related Questions