SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Open EDI file in SQL Server


Open EDI file in SQL Server

Author
Message
ramadesai108
ramadesai108
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2325 Visits: 690
Is there a way to open EDI file in SQL Server and insert the data into tables?

Thanks.
bitbucket-25253
bitbucket-25253
SSCoach
SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)

Group: General Forum Members
Points: 15183 Visits: 25280
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
ramadesai108
ramadesai108
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2325 Visits: 690
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
Lowell
Lowell
SSC Guru
SSC Guru (68K reputation)SSC Guru (68K reputation)SSC Guru (68K reputation)SSC Guru (68K reputation)SSC Guru (68K reputation)SSC Guru (68K reputation)SSC Guru (68K reputation)SSC Guru (68K reputation)

Group: General Forum Members
Points: 68779 Visits: 40905
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
--help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!
ramadesai108
ramadesai108
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2325 Visits: 690
Thank you Lowell. This is very helpful. I am very new with EDI.
ramadesai108
ramadesai108
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2325 Visits: 690
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.
Lowell
Lowell
SSC Guru
SSC Guru (68K reputation)SSC Guru (68K reputation)SSC Guru (68K reputation)SSC Guru (68K reputation)SSC Guru (68K reputation)SSC Guru (68K reputation)SSC Guru (68K reputation)SSC Guru (68K reputation)

Group: General Forum Members
Points: 68779 Visits: 40905
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
--help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!
ramadesai108
ramadesai108
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2325 Visits: 690
We do not have the layout file, how do I create one or where do I get one?

Thanks.
Lowell
Lowell
SSC Guru
SSC Guru (68K reputation)SSC Guru (68K reputation)SSC Guru (68K reputation)SSC Guru (68K reputation)SSC Guru (68K reputation)SSC Guru (68K reputation)SSC Guru (68K reputation)SSC Guru (68K reputation)

Group: General Forum Members
Points: 68779 Visits: 40905
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
--help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!
ramadesai108
ramadesai108
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2325 Visits: 690
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search