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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 File With Multiple Data Set

Author  Topic 

Ghanta
Yak Posting Veteran

96 Posts

Posted - 2011-01-07 : 16:35:42
Hi Guys,

I am sure some of you might have dealt with the situation that I am in... wanted to check the efficient way to do this.... I have fixed width flat file; however, this file will have data for several tables based on the values in the positions 9, 10 and 11... and each set has different layout.... has different fields and different starting and ending positions, but the length of each line is same.

For example

Pos 9, 10, 11 distinguish where that particular record should loaded and the file has "Z" at the last Pos which is 900:

20110107001John Doe M34
20110107002231M Street Germantown AL

In the above example say 001 goes to individual table and 002 goes to address table... Is there a way we can use SSIS or sql to parse different layouts from one file? What is the better way guys? I was thinking about staging in a table with one column and then parsing...

Thanks!



dataguru1971
Master Smack Fu Yak Hacker

1464 Posts

Posted - 2011-01-07 : 17:01:24
SSIS ..you can do this with a conditional split. http://msdn.microsoft.com/en-us/library/ms137530.aspx?PHPSESSID=6c7e47uec18v8n3121a6p001h4



Poor planning on your part does not constitute an emergency on my part.

Go to Top of Page

Ghanta
Yak Posting Veteran

96 Posts

Posted - 2011-01-07 : 17:04:50
quote:
Originally posted by dataguru1971

SSIS ..you can do this with a conditional split. http://msdn.microsoft.com/en-us/library/ms137530.aspx?PHPSESSID=6c7e47uec18v8n3121a6p001h4



Poor planning on your part does not constitute an emergency on my part.





Thanks a lot dataguru... I was wrong about multicast actually, like you said, it is conditional split...
Go to Top of Page

Ghanta
Yak Posting Veteran

96 Posts

Posted - 2011-01-07 : 17:07:06
So for file connection I should be having multiple connection for each source file rite for each data set as they have different layout?
Go to Top of Page
   

- Advertisement -