Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 123»»»

Open EDI file in SQL Server Expand / Collapse
Author
Message
Posted Thursday, September 27, 2012 6:23 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, January 28, 2014 3:52 PM
Points: 377, Visits: 685
Is there a way to open EDI file in SQL Server and insert the data into tables?

Thanks.
Post #1365565
Posted Thursday, September 27, 2012 7:44 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, September 18, 2014 7:50 PM
Points: 5,322, Visits: 25,235
There are many formats for EDI files ... generally set by the partners (sender & receiver). So like many things in SQL the phrase "It depends" applies to your request.

To help those who can and will help you can you supply a sample of the file ?

Be sure NOT to include any propriatory data, or data which can iidentify a particular individual and / or business.

With that data I am sure someone will assist you.


If everything seems to be going well, you have obviously overlooked something.

Ron

Please help us, help you -before posting a question please read

Before posting a performance problem please read
Post #1365577
Posted Friday, September 28, 2012 8:40 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, January 28, 2014 3:52 PM
Points: 377, Visits: 685
Thank you Ron. Here is the EDI 271 File sample: I would truly appreciate if someone can help.

ISA*00* *00* *ZZ*0000110101 *ZZ*GrpSS *120510*0613*^*00501*131061332*0*P*:~GS*HN*123456789*123456789*20120510*0613*1*X*005010X212~ST*277*000000001*005010X212~BHT*0010*08*QA0000*20120510*0513*DG~HL*1**20*1~NM1*PR*2*UC*****PI*11111~HL*2*1*21*1~NM1*41*2*HC*****46*0003290000~HL*3*2*19*1~NM1*1P*2*HC*****XX*0003290000~HL*4*3*22*0~NM1*IL*1*FName*LName****MI*000368000~TRN*2*000009700~STC*A4:0*00000500~DTP*472*D8*00020002

Thanks
Post #1365910
Posted Friday, September 28, 2012 8:55 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 12:01 PM
Points: 12,899, Visits: 32,113
formatted a bit for readability;
similar to some EDI files I handle, it looks like the tilde(~) is the delimiter for message segments;
the ISA segment is a control header for "who from" information;

each segment is sandwiched between ~ST for Segment Start and ~STC for Segment end.

the internal part is different from what I've processed myself, this may help folks a bit.

ISA*00* *00* *ZZ*0000110101 *ZZ*GrpSS *120510*0613*^*00501*131061332*0*P*:~GS*HN*123456789*123456789*20120510*0613*1*X*005010X212
~ST*277*000000001*005010X212
~BHT*0010*08*QA0000*20120510*0513*DG
~HL*1**20*1
~NM1*PR*2*UC*****PI*11111
~HL*2*1*21*1
~NM1*41*2*HC*****46*0003290000
~HL*3*2*19*1
~NM1*1P*2*HC*****XX*0003290000
~HL*4*3*22*0
~NM1*IL*1*FName*LName****MI*000368000
~TRN*2*000009700
~STC*A4:0*00000500
~DTP*472*D8*00020002


Lowell

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #1365922
Posted Friday, September 28, 2012 9:27 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, January 28, 2014 3:52 PM
Points: 377, Visits: 685
Thank you Lowell. This is very helpful. I am very new with EDI.
Post #1365957
Posted Friday, September 28, 2012 10:12 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, January 28, 2014 3:52 PM
Points: 377, Visits: 685
Lowell,
If you have dealt with EDI before, can you please point me in the right direction? How did you import the data from EDI to SQL Server?

Thanks.
Post #1365994
Posted Friday, September 28, 2012 10:44 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 12:01 PM
Points: 12,899, Visits: 32,113
well, like Ron/bitbucket said; there's many formats to an EDI file; somewhere someone on your side should have put together a document mapping out each element;

once you have that document, it's fairly easy to split the data on the delimiter and stick them in the right tables;
but without that layout i couldn't offer much except to point you to examples, sorry.


Lowell

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #1366016
Posted Friday, September 28, 2012 11:45 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, January 28, 2014 3:52 PM
Points: 377, Visits: 685
We do not have the layout file, how do I create one or where do I get one?

Thanks.
Post #1366043
Posted Friday, September 28, 2012 11:50 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 12:01 PM
Points: 12,899, Visits: 32,113
ramadesai108 (9/28/2012)
We do not have the layout file, how do I create one or where do I get one?

Thanks.

ouch, there is seriously no "easy" way on this then.

to the best of my knowledge, you cannot jsut magically create one;
each field, their meaning, data type and min/max values are all business dependent;
it might be if you have some code that either creates or reads the edi file iteself, you need to go through the code.

here's an example layout of one file the US gove happens to use; it goes to teh trouble to breakd own every value;
you need something similar to make heads or tails of the incoming data.

http://www.hud.gov/offices/cpd/systems/idis/edi/idis_edi_records_layout.pdf



Even an experienced code monkey like me would need something like that as a starting reference.


Lowell

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #1366050
Posted Friday, September 28, 2012 2:35 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, January 28, 2014 3:52 PM
Points: 377, Visits: 685
Thank you, but I do not have any layout. There must be some one who is expert on this, or has some idea how I can proceed.

Thanks.
Post #1366116
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse