Multiple Inserts into SQL Server

  • Thread starter Thread starter Rathtap
  • Start date Start date
R

Rathtap

My task is to read from an EDI file (837) and insert data into various
tables in a SQL Server database. I cannot use BCP or DTS because the
data in the EDI file is not formatted in a way that I could use with
those features.
There is a lot of data and a lot of inserts.
I plan to use an insert stored procedure for each table that will
receive records and execute it with a SqlCommand.
I wonder if there is a better way to do it since data will be going to
about 40 tables and there will be between 10 to 45 columns in each
table -- a lot of coding. Can I do this better using a SqlDataAdapter
or some other Data class?
Any help is appreciated.
 
You can try to make datatable object, fill it with data you want it and,
then sqldataadapter's update method where you call stored procedure to
insert data in different tables.

Try to call only one stored procedure from .net environment and rest of the
things, let the stored procedure handle.


Rajesh Patel
 
Thanks for the reply,
Could you please elucidate. I am not quite sure what you mean- maybe
it is because I lack the requisite .Net IQ -- some sample code will go
a long way to clarify.
 
Back
Top