[quoted text, click to view] > That does complicate things. Can you give me rough estimates of the row
> counts of the 16 tables plus the row count of the data you're
> importing?
Fortunately for my lookups (in validation process) ,tables have maximum of 6
records(it's not a big deal). When the validation is done I need to make
sure that that record dosn't exist in two tables(Table1 and Table2.this part
is my business ruke then) with about 300,000 records each(600,000 records in
total).You don't tell me that I should reconnect to database from client or
load that table into client as a lookup?:-)
[quoted text, click to view] > Also, you're saying that you need a mechnism to split records into
> different tables. Are you just referring to the valid table plus the
> errors table?
Look,I use the error Table only for validation process,if there is any
problem during the validation for each record ,I won't check the business
rules.after I have done validation and bizrules I have to send good records
to two different table (some fields of each record gose to one Table and
some fields of each reocrd gose to another Table)
[quoted text, click to view] > Making A LOT of assumptions here, and very well may be revised based on
> answers to the above questions, here's what I would do personally,
> keeping in mind that I'm a programmer, so code doesn't bother me, but
> might bother you. I think it would result in the best control, the best
> functionality, and the best efficiency/speed.
I'm programmer too,as I told you I implemented the same scenario using a CSV
parser and finally I ended up myself in a situation that I have to use DTS
in order to transfer CSV file records into Database,so I thought if I'm
supposed to use DTS anyways ,why not having everything in DTS ,since it's
much easier to be deployed than having one peice as a webservice for
instance and a DTS package besides that.
[quoted text, click to view] > Get a fast csv parser, which I sell a fast cheap one, if you need.
> Assuming the 16 tables are hardly ever edited, and reasonably small
> enough to sit in RAM, I'd load those tables into static HashTable's in
> C#, using the name for the key, and primary key value as the value.
> You'd only have a one time hit for the load, and fast lookups after
> loaded. I'd then loop over the source file. Find the corresponding
> values from the 16 lookups using the HashTables. Then, run your
> business logic. If any of this fails, send the row to a bad data csv
> file. If the row passes all checks, send the row to a good data csv
> file. When you're done processing, run a dts package with one data pump
> task of the good data csv file into the final table, or a loading
> table. There'd also be another data pump task of the bad data csv file
> into your errors table. Obviously, this is a very specific solution,
> but it's how I'd go about it.
It's exactly what I did before,my problem is Business rules.How are yuo
going to enforce them ??using an stored procedure??? using direct connection
to Database,you won't probably load 600,000 records to your dataset to check
the business rules? so you kind of have to check the business rules in
server,right? then you end up yuorself having designed your suystem with a
different components ,one client ,one good cvs file,one bad CSV file,one
stored procedure for business rules and one DTS package.Don't you think it
makes a it really deficult for the tester and operation department to follow
all these rules.but in my scenarion,I have only one DTS package (AS I said
before,there is no flexibility(which I don't care because I got what I
wanted from DTS,except a few thing ,there might be performance issue (which
I don't think is worse than client appraoch)
[quoted text, click to view] >
> If this is something horribly important and going to be run a lot in
> your company, I'd try multiple ways of doing it, to see the
> differences. Triggers and Stored Procedure calls and Lookup calls in
> the middle of your DTS data pump task is going to make this process
> crawl in comparison to what I suggested above, but you don't have to
> take my word for it. I'd really recommend very simple test scenarios so
> you get comfortable with your tradeoffs and limitations.
oh,I so appreciate your time,you have spent at least five minutes to solve
my problem where you didn't have to :-),I really appreciate it ,we want to
disguss this issue and it gives me the opportunity to make a good decision
and for the others with the same problem a good underestanding ;-) I still
didn't underestand how you want to enforce business rules..you may answer
based on the information I gave you above.
Thanks very much for your nice reply,
Ray