Interview Question....
Hi ,
I have been following this forum since last month. Got Good o/p out of this. I have been attempting an interview with one of the MNC. I was not able to figure out the question mentioned below. Can someone please suggest an suitable answer
We have flat file source and destination SQL server. The issue is the delimiter. It can be " , " or an " | " How can i handle this situation without editing the package everytime the delimiter is changed ??? Is there an option in SSIS to handle
this situation ?
Regards,
Indraneel A
July 19th, 2011 12:51am
You can specify the delimiter in the configuration file
or you want the system to identify the delimiter on its own during execution????
for run time using a script task is a good option to identify the delimiter
--------------------------------------------------------
Surender Singh Bhadauria
Free Windows Admin Tool Kit Click here and download it now
July 19th, 2011 12:56am
Hello,
YEs you can handle this without changing and opening your package.
Steps:
1--create a variable , lets say VarDelimiter string type and by default value ,
2--Go to Flat File Connection Manager, then Expressions, Click on Property Drop Down, then Select RowDelimiter or if you want to change for HeaderColumnDelimiter and Then Click Expression Button right infront of it, and in Editor Drag your Variable( @[User::VarDelimiter])
from Variable List.
3--Create configuration for this Variable ( VarDelimiter) , you can use SQL Server Table Configuration, flat file or XML
4-- Now whenever you want to change the Delimiter you need to only update in Configuration table or file and do not have to open package.
Configuration Link
http://msdn.microsoft.com/en-us/library/cc895212.aspx
Write Expression in SSIS
http://www.youtube.com/watch?v=pSElDmmBOsw
Thanks
http://sqlage.blogspot.com/
July 19th, 2011 1:35am
Hi Aamir/Surender,
Thx for your quick responses. In the interview i told that we can achieve this with Script task, but in reality i was not sure, thats just an wild guess. I wanted to try your solution which you jotted above.
I am a newbie to SSIS, so if you have some scenario's like the above can please jot them down for me ??? Wanna solve them by myself :)
Regards,
Indraneel A
Free Windows Admin Tool Kit Click here and download it now
July 19th, 2011 4:13am
But my question is still there that do you want to identify the delimiter during run time if it is during run time then configuration will not work in that case you have to use a script task and identify the delimiter and then set to a variable that will
be used to set the delimiter option of the Flat File Connection Manager as aamir suggested
--------------------------------------------------------
Surender Singh Bhadauria
July 19th, 2011 4:28am