Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
spikerdallas
Starting Member
2 Posts |
Posted - 2004-08-17 : 18:09:01
|
| I have several EDI files I am parsing and importing into SQL Server 2000 in C#. The problem is I am hitting a database in Houston from Dallas and some of the parsing takes a long time. Here is the dataSH|DEBTX183529049USE|CMR000318129820040623867040698|01|DEBTX183529049USE|TX|SU|||CMR000318129820040623867040698||1039940674000|ONCOR|0397133541000|REPUBLIC POWER, LP D/B/A DIRECT ENERGY BUSINESS SERVICES|200406230000|200406230715||||||||||||||||||||||10443720003181298|ERCOT|183529049||201209|30|DEBTX183529049USE|068167154SA|20040622|35|DEBTX183529049USE|QD|KH|3925|51|SH & 01 - is my header going to one table30 goes to a different table35 to a different one etc.etc.I also need to create relations with these tables.Any ideas what the best solution to this is?The current application just takes it one line at a time and writes to the specific database table. So the ultimate problem is too many hits to the database.ThanksGreg |
|
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2004-08-17 : 18:15:56
|
| Well, first of all, dump the entire file to the source database in one process. After that, parse and disseminate to the rest of the server. You also might want to consider setting up a fileshare the SQL Server can access. You could drop the whole import file in, then use DTS or bcp to import the file into a SQL table with appropriate columns. After that, run INSERT statements into the final tables.MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
|
spikerdallas
Starting Member
2 Posts |
Posted - 2004-08-17 : 18:26:38
|
| Can I still obtain key information from the previous files...fortunately the data comes over in order and I can build relationships along the way. I use identity fields and then place them as foreign keys into the tables. How would I do that? |
 |
|
|
|
|
|