If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Application Design Help

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-27-09, 13:42
khdani khdani is offline
Registered User
 
Join Date: Nov 2008
Posts: 20
Application Design Help

Hello,
I need to create an application which works with a database, it's a bank account management application. All transactions should be recorded in some temporary storage and a batch program should update the main database according to the temporary records. (The application will be developed in .NET using C#).

I thought of creating a DataSet (in memory cache storage) of the records, manipulating them and then the batch program would update the main database with the DataSet...

I would like to hear suggested technique to implement this? some more "correct" way of doing this...

Thank you
Reply With Quote
  #2 (permalink)  
Old 04-27-09, 14:00
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
Create a staging table in the database.
Create a sproc that cleanses, verifies, and distributes the data in the staging table.
Advantage: You can set up multiple imports into the same staging table and they can all use the same code logic.
__________________
If it's not practically useful, then it's practically useless.

blindman
www.chess.com: "sqlblindman"
Reply With Quote
  #3 (permalink)  
Old 04-27-09, 14:28
khdani khdani is offline
Registered User
 
Join Date: Nov 2008
Posts: 20
staging table - it seems that it's exactly what i need
is this a regular table which manipulated by sql functions ?
can you direct me please on some guides for creating staging tables, i can't find much information about it, or how to create it?
Reply With Quote
  #4 (permalink)  
Old 04-28-09, 03:42
loquin loquin is offline
Super Moderator
 
Join Date: Jun 2004
Location: Arizona, USA
Posts: 1,797
You create a staging table in exactly the same way you create any other table... It's just a table used to hold the import data temporarily.
__________________
Lou
使大吃一惊
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert

Reply With Quote
  #5 (permalink)  
Old 04-28-09, 12:12
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
My own method is to create staging tables that either model the current physical architecture of the database, or are completely denormalized to match the anticipated data that will be received. Your staging table should consist primarily of varchar columns with no constraints, so that errors rarely occur when loading data into them. Your stored procedure will actually verify these character columns as valid datetime, int, float, or other datatypes, and note any discrepancies.
I also add auditing columns on each of my staging tables for recording the datasource, the timestamp of when the data was received, and for noting any errors that occurred during processing.
__________________
If it's not practically useful, then it's practically useless.

blindman
www.chess.com: "sqlblindman"
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On